标签:io ar sp cti on c amp ad ef
//左导航高亮
(function(){
var leftnav = $(‘#leftnav‘); //左侧ul
var pi = __preset.curpathid;
if(pi==‘/account‘) pi += ‘/index‘;
if(pi.match(/(\/[a-z]+){3}/)){
var a = pi.split(‘/‘);
pi = ‘/‘+a[1]+‘/‘+a[2];
}
var curnav = leftnav.find(‘li a[href="‘+pi+‘"]‘); //当前点击的a
if(curnav.length&&!curnav.find(‘a‘).hasClass(‘active‘)){
leftnav.find(‘a.active‘).removeClass(‘active‘); //移除以前存在的active
curnav.addClass(‘active‘); //给当前点击的添加active类
}
})();
标签:io ar sp cti on c amp ad ef
原文地址:http://www.cnblogs.com/yangjing1314/p/3973288.html