An efficient DHTML menu script for creating animated, cross-platform dynamic menus similar to those found in GUI interfaces.
The menus are activated with a smooth, platform independent, decelerated
animation and can expand in different directions: up, down, left or right.
Selected instances do not have to be positioned as to overlap with their actuators.
EXAMPLE
1)Download
this ZIP file with the ypSlideOutMenus.js script file and the rollover
images, and unzip into
the appropriate directory.
2) Insert these scripts with the <STYLE> tag in the <HEAD> section of the
page (or place the style tags in a CSS stylesheet and place the call to the
stylesheet instead).
3) Insert the following HTML code anywhere in the <BODY> section of the page.
4) Insert the following HTML code also in the <BODY> section where you
want the rollover buttons to appear in the page.
5) Insert the onLoad event handler inside the <BODY> tag
as follows:
<body onload="preloadImages('/menu_script/button1_on.gif','/menu_script/button2_on.gif','/menu_script/button3_on.gif',
'/menu_script/button4_on.gif','/menu_script/button5_on.gif')", followed by other tags such as bgcolor, etc..
6) Define the rollover buttons and assign them the appropriate menu in
this section of the HTML code:
9) Customize the content of the menus in
this section of the HTML code:
<!-- Begin SubMenu1 -->
<DIV id=menu1Container>
<DIV id=menu1Content>
<TABLE cellSpacing=0 cellPadding=0 width=142 border=0> //
the menu width
<TBODY>
<TR>
<TD onmouseover="ypSlideOutMenu.showMenu('menu1')" onmouseout="ypSlideOutMenu.hideMenu('menu1')"
vAlign=center align=left width=142 height=17>
<A class=rollmenu href="http://simplythebest.net"> <SPAN
class=menuhead>Directories</SPAN></A></TD></TR>
<TR>
<TD onmouseover="ypSlideOutMenu.showMenu('menu1')" onmouseout="ypSlideOutMenu.hideMenu('menu1')"
vAlign=center align=left width=142 height=17>
<A class=rollmenu href="cgi_scripts/cgi_scripts.html">CGI scripts</A></TD></TR>
<TR>
<TD onmouseover="ypSlideOutMenu.showMenu('menu1');ypSlideOutMenu.showMenu('menu11')"
onmouseout="ypSlideOutMenu.hideMenu('menu1');ypSlideOutMenu.hideMenu('menu11')"
vAlign=center align=left width=142 height=17>
<A class=rollmenu href="scripts/dhtml_scripts.html">DHTML scripts</A>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV></DIV>
<!-- End SubMenu1 -->
<!-- Begin SubMenu11 -->
<DIV id=menu11Container>
<DIV id=menu11Content>
<TABLE cellSpacing=0 cellPadding=0 width=106 border=0>
//
the menu width
<TBODY>
<TR>
<TD onmouseover="ypSlideOutMenu.showMenu('menu1');ypSlideOutMenu.showMenu('menu11')"
onmouseout="ypSlideOutMenu.hideMenu('menu1');ypSlideOutMenu.hideMenu('menu11')"
vAlign=center align=left width=106 height=17>
<A class=rollmenu href="scripts/dhtml_menu_scripts.html">Menu scripts</A>
</TD>
</TR>
<!-- End SubMenu11 -->
<!-- Begin SubMenu2 -->
<DIV id=menu2Container>
<DIV id=menu2Content>
and so forth...
10) Adjust the speed of the menus and the delay time in this
section of the ypSlideOutMenus.js file:
ypSlideOutMenu.aniLen = 650 // speed of
the menus, the higher the value the slower the animation
ypSlideOutMenu.hideDelay = 325 // delay time before the menus
close
11) Define the path to the script file in the script tag in the <HEAD>
section: