eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('19.15(\'17\',b(){4 v=$w(\'.1k .n-9-A-1\');6(!v[0])h;4 H=b(E,y){4 z;6((z=(y+\'\').1j(E))){h y.U(z+E.r)}};4 s=b(D){6(!D)h\'\';h H(\'/\',D).B(/^(1i\\.V)?(\\?)?/i,\'\').B(/%Z/J,\',\')};4 o=b(I){4 7=s(I).B(/12/J,\'\').11(\'-\');6(7[2]){6(/t,\\d+/.G(7[2])){7[1]+=\'-\'+7[2].K(/^(.+)?(t,\\d+)(.+)?$/)[2]}10 6(/^p,\\d+/.G(7[2])){7[1]+=\'-\'+7[2].K(/^(p(,\\d+)+)(.+)?$/)[1]}}h 7[1]+(7[3]?(\'-\'+7[3]):\'\')};4 L=u=W.j,n;6(u.X(\'13\')!=-1){u=(n=$w(\'.14 a\'))&&n.r?s(n[n.r-1].j):u}4 u=o(u);4 8=1g;v.1f(b(9,i){4 c=9.g(\'.n-9-c\');4 a=$w(\'a\',9);6(u==o(a[0].j)){9.F(\'8\',a[0].l(\'8\'))}4 m;1l(4 i=1;i<a.r;i++){4 k=a[i];6(!8&&(L==k.j||u==o(k.j))){k.l(\'1c\');9.F(\'8\',a[0].l(\'8\'));8=1a}m=k.Y();6(m.1b(\'m\')){m.M({\'Q\':b(e){f.g(\'.n-9-c-3\').18({\'q\':\'S\',\'16\':\'-1d 0 0 \'+(f.1e().x-5)+\'1h\'});f.g(\'.A-3\').l(\'O\')},\'T\':b(){f.g(\'.n-9-c-3\').C(\'q\',\'R\');f.g(\'.A-3\').P(\'O\')}})}}6(c){9.M({\'Q\':b(){c.C(\'q\',\'S\');6(!f.N(\'8\'))a[0].l(\'8\')},\'T\':b(){c.C(\'q\',\'R\');6(!f.N(\'8\'))a[0].P(\'8\')}})}})})',62,84,'||||var||if|pros|current|cat||function|popup|||this|getElement|return||href|a1|addClass|sub||furl||display|length|findext|||cats|ES||str|pos|depth|replace|setStyle|src|needle|store|test|findend|url|ig|match|local|addEvents|retrieve|on|removeClass|mouseenter|none|block|mouseleave|substr|php|location|indexOf|getParent|2C|else|split|_ANY_|product|Navigation|addEvent|margin|domready|setStyles|window|true|hasClass|now|25px|getSize|each|false|px|index|lastIndexOf|GoodsDropNavs|for'.split('|'),0,{}))
这一段代码,如何解读?有望高手 非常感谢!<div class="GoodsDropNavs">
<li class="n-cat-depth-1 nobg"><a class="depth-1" href="./"><em>首页</em></a></li>
<{foreach from=$data item=parent key=parentId}>
<li class="n-cat-depth-1"><a class="depth-1" href="<{link ctl='gallery' act=$setting.view arg0=$parentId}>"><em><{$parent.label}></em></a>   PS:它是一段遍历代码,能自动生成新行!如何改写上面一段JS代码,在这一段代码<li class="n-cat-depth-1"><a class="depth-1" href="<{link ctl='gallery' act=$setting.view arg0=$parentId}>"><em><{$parent.label}></em></a>自动生成两个的时候判断它的下的子行,并写入CSS?PS:先在这里感谢能帮助我的JS高手!

解决方案 »

  1.   

    搜索一下js解密window.addEvent('domready',
    function() {
    var cats = $ES('.GoodsDropNavs .n-cat-depth-1');
    if (!cats[0]) return;
    var findend = function(needle, str) {
    var pos;
    if ((pos = (str + '').lastIndexOf(needle))) {
    return str.substr(pos + needle.length)
    }
    };
    var findext = function(src) {
    if (!src) return '';
    return findend('/', src).replace(/^(index\.php)?(\?)?/i, '').replace(/%2C/ig, ',')
    };
    var furl = function(url) {
    var pros = findext(url).replace(/_ANY_/ig, '').split('-');
    if (pros[2]) {
    if (/t,\d+/.test(pros[2])) {
    pros[1] += '-' + pros[2].match(/^(.+)?(t,\d+)(.+)?$/)[2]
    } else if (/^p,\d+/.test(pros[2])) {
    pros[1] += '-' + pros[2].match(/^(p(,\d+)+)(.+)?$/)[1]
    }
    }
    return pros[1] + (pros[3] ? ('-' + pros[3]) : '')
    };
    var local = u = location.href,
    n;
    if (u.indexOf('product') != -1) {
    u = (n = $ES('.Navigation a')) && n.length ? findext(n[n.length - 1].href) : u
    }
    var u = furl(u);
    var current = false;
    cats.each(function(cat, i) {
    var popup = cat.getElement('.n-cat-popup');
    var a = $ES('a', cat);
    if (u == furl(a[0].href)) {
    cat.store('current', a[0].addClass('current'))
    }
    var sub;
    for (var i = 1; i < a.length; i++) {
    var a1 = a[i];
    if (!current && (local == a1.href || u == furl(a1.href))) {
    a1.addClass('now');
    cat.store('current', a[0].addClass('current'));
    current = true
    }
    sub = a1.getParent();
    if (sub.hasClass('sub')) {
    sub.addEvents({
    'mouseenter': function(e) {
    this.getElement('.n-cat-popup-3').setStyles({
    'display': 'block',
    'margin': '-25px 0 0 ' + (this.getSize().x - 5) + 'px'
    });
    this.getElement('.depth-3').addClass('on')
    },
    'mouseleave': function() {
    this.getElement('.n-cat-popup-3').setStyle('display', 'none');
    this.getElement('.depth-3').removeClass('on')
    }
    })
    }
    }
    if (popup) {
    cat.addEvents({
    'mouseenter': function() {
    popup.setStyle('display', 'block');
    if (!this.retrieve('current')) a[0].addClass('current')
    },
    'mouseleave': function() {
    popup.setStyle('display', 'none');
    if (!this.retrieve('current')) a[0].removeClass('current')
    }
    })
    }
    })
    })