PDA

View Full Version : Fold-out External Menu



dlms55
04-11-2006, 04:30 PM
I'm using the fold-out external menu (LINK TO SCRIPT PAGE (http://www.dynamicdrive.com/dynamicindex1/slideinmenu4.htm)) and have had some users ask if the menu can be changed so that they have to click on it to open it and then stays open until they select a menu item. Basically they want click behavior not hover.

I've looked at the script so long my eyes are going buggy and I just can't see the forest for the trees. The answer is probably staring me in the face, but I just can't see it.

Can anyone help me figure out how to get this script to work as a click to slide out/in instead of the mouseover?

Thanks!

ddadmin
04-11-2006, 06:41 PM
Sure, just replace the default BODY tag inside your external menu file (ie: menu.htm), for example:


<body onMouseover="if ((document.all||document.getElementById)&&window.parent.pull) window.parent.pull()"
onMouseout="if ((document.all||document.getElementById)&&window.parent.pull) window.parent.draw()" topmargin="5" leftmargin="5"
marginwidth="5" marginheight="5">

to:


<script type="text/javascript">
var currentmenustate="close"
function showorhide(){
if (currentmenustate=="close"){
window.parent.pull() //open menu
currentmenustate="open"
}
else{ //close menu
window.parent.draw()
currentmenustate="close"
}
}

</script>

<body onClick="showorhide()" topmargin="5" leftmargin="5"
marginwidth="5" marginheight="5">

dlms55
08-28-2007, 09:28 PM
I'm very happy with the fold-out menu (http://www.dynamicdrive.com/dynamicindex1/slideinmenu4.htm). I'm wondering if the floating part of the floating iframe script (http://www.dynamicdrive.com/dynamicindex17/floatiframe.htm) can be combined with the fold-out (slide0in) menu so that it follows user down the page.

Thanks!