http://www.efeihu.com/Pages/ProductShow/ProductSecond.aspx?id=21&pid=5&category_id=0&sort=1
这个左导航产品下拉类别功能(点击当前链接自动排序到第一位的功能)我没做出来,不知哪位高手,帮解答下,多谢,这样给客户的体验非常好.
就是不知道根据什么来参数来排序?
js部分:
<script language="javascript">
//处理分类的收缩展开
(function(){
var doms = document.getElementById('menu_chunk_c').getElementsByTagName('div'),len = doms.length,currDom = null;
for(var i=0;i<len;i++){
if(doms[i].className.indexOf('item_big') != -1){
doms[i].onclick = clickFn;
}
}
function setDisplay(o,ul,isShow){
var cls = ' ' + o.className;
if(isShow){
o.className = cls.replace(' item_big_curr','')+' item_big_curr';
ul.style.display = 'block';
currDom = o;
}else{
o.className = cls.replace(' item_big_curr','');
ul.style.display = 'none';
}
}
function clickFn(e){
var e = e || window.event,el = e.target || e.srcElement,o = this,ul = o.parentNode.getElementsByTagName('ul')[0];
if(el.tagName.toLowerCase() == 'a'){
return;
}
var isShow = (!ul.offsetWidth) ? true : false;
if(currDom != o){
setDisplay(currDom,currDom.parentNode.getElementsByTagName('ul')[0],!isShow);
}
setDisplay(o,ul,isShow);
};
var first = doms[0],f_o = first.getElementsByTagName('div')[0],f_ul = first.getElementsByTagName('ul')[0],currDom = f_o;
setDisplay(f_o,f_ul,true);
})();
</script>
已经解决