ddlevelsmenu在IE6下,与select冲突的解决办法【整理】

原讨论贴:http://topic.csdn.net/u/20090511/11/d176e9da-7b96-4197-abc1-cf02ccbe1982.html

ddlevelsmenu感觉还是比较好用的,但是在万恶的IE6下面还是会出现不少问题,其中一个就是:
与<select>标签会有冲突,子菜单无法弹出,google一下,发现一个解决办法。


在ddlevelsmenu.js 里有一句 ddlevelsmenu.positionshim(this, submenu, dir, scrollX, scrollY) ,将里面两行代码注释掉即可:

Code
positionshim:function(header, submenu, dir, scrollX, scrollY){
    
//alert(dir)
    if (header._istoplevel){
        
var scrollY=window.pageYOffset? window.pageYOffset : this.standardbody.scrollTop
        
var topgap=header._offsets.top-scrollY
        
var bottomgap=scrollY+this.docheight-header._offsets.top-header._dimensions.h
        
if (topgap>0){
            
this.shimmy.topshim.style.left=scrollX+"px"
            
this.shimmy.topshim.style.top=scrollY+"px"
            
this.shimmy.topshim.style.width="99%"
            
//this.shimmy.topshim.style.height=topgap+"px" //distance from top window edge to top of menu item
        }
        
if (bottomgap>0){
            
this.shimmy.bottomshim.style.left=scrollX+"px"
            
this.shimmy.bottomshim.style.top=header._offsets.top + header._dimensions.h +"px"
            
this.shimmy.bottomshim.style.width="99%"
            
//this.shimmy.bottomshim.style.height=bottomgap+"px" //distance from bottom of menu item to bottom window edge
        }
    }
}


子菜单无法弹出的问题解决,但是IE6下DIV无法盖住SELECT的Bug会出现,还好,这个bug还在可接受范围之内。
上了ddlevelsmenu菜单的贼船,只有认了。

 

posted @ 2009-06-24 18:00  stu_acer  阅读(470)  评论(0编辑  收藏  举报