首页 新闻 搜索 专区 学院

点击当前链接自动排序到第一位的功能

0
悬赏园豆:60 [待解决问题]

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>

沈大荣的主页 沈大荣 | 初学一级 | 园豆:2
提问于:2011-12-01 20:48
< >
分享
所有回答(1)
0

已经解决

沈大荣 | 园豆:2 (初学一级) | 2011-12-16 20:43
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册