Sure, here's a quick way to combine both functions to the original AnyLink Vertical Menu (so it can drop down as well).
Inside the script, replace the following chunk of code:
Code:
function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)
if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+horizontaloffset+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"
}
with:
Code:
function dropdownmenu(obj, e, menucontents, menuwidth, istop){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)
if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-(istop? 0 : clearbrowseredge(obj, "rightedge")-obj.offsetWidth+horizontaloffset)+"px"
dropmenuobj.style.top=dropmenuobj.y+(istop? obj.offsetHeight : -clearbrowseredge(obj, "bottomedge"))+"px"
}
}
Then in your HTML, if you want an anchor link to cause its drop down menu to drop down instead of to the right, pass in a 3rd parameter:
Code:
<a href="default.htm" onMouseover="dropdownmenu(this, event, menu1, '165px', 'istop')" onMouseout="delayhidemenu()">Webmaster Links</a>
The only caveat is that the drop down function doesn't account for right/bottom window edges as the drop right function does.
Edit: Edited code for errors
Bookmarks