appeared with Internet Explorer 6.0 (Win XP)
condition: function dropdownmenu called in a link without value for 4th parameter (menuwidth)
Hello,
I used the AnyLink Drop Down Menu at http://www.amateurtheater.de/ (red navigation menu) without a setting for menuwidth (4th parameter) in onMouseover to call function dropdownmenu:
"No problem", I thought. "A default value is given."Code:<a href="/online/" onMouseover="dropdownmenu(this, event, menu_online)" onMouseout="delayhidemenu()">Online</a>
But when I checked my pages with IE 6 I received an error. After some trail and error I found the reason within function showhide:Code:var menuwidth='165px' //default menu width
If menuewidth is not set at function call of dropdownmenu (onMouseover), then menuewidth is not empty (menuwidth!="") but undefined (the default value of menuwidth is overwritten by function call).Code:function showhide(obj, e, visible, hidden, menuwidth){ if (ie4||ns6) dropmenuobj.style.left=dropmenuobj.style.top=-500 if (menuwidth!=""){ dropmenuobj.widthobj=dropmenuobj.style dropmenuobj.widthobj.width=menuwidth } if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") obj.visibility=visible else if (e.type=="click") obj.visibility=hidden }
My solution: I modifed the "if" statement:
Hope, you can follow my thought with this explanation and this bug is not only an error of me.Code:if ((typeof menuwidth!="undefined") && (menuwidth!="")){ dropmenuobj.widthobj=dropmenuobj.style dropmenuobj.widthobj.width=menuwidth }![]()
alexzey



Reply With Quote
Bookmarks