Click to See Complete Forum and Search --> : Dreamweaver MX and javascript


JohnnieCat
01-19-2003, 06:28 PM
Hey all! Hoping someone out there can help me with this simple (i"m sure) problem that I'm too blond to figure out!

I am creating a few menus in Dreamweaver MX that are actually layers that show/hide when their link is activated with "onmouseover". I can get them all to show and to hide when I go down to the next menu item to have that ones layer show but what I want now is for the menus to completely disappear when the mouse leaves the menu items.

So in other words I have a list of links that when you mouseover them a menu appears beside them. When the mouse goes on to the next link the previous menu disappears and the next menu shows. But when the mouse is off the list of links the last menu item that was showing stays visible.

How do I get it to hide? Check out what I mean at http://members.shaw.ca/mrsdunnsclass/ (keep in mind this is work in prgress so its not any where near finished!


Any suggestions would be greatly appreciated!!!!!!

swon
01-19-2003, 06:55 PM
do something like that:

<script language="JavaScript">
<!--
i=0;
timering= 5; // seconds to go hidden

function hiding(){
var lay = new Array("layer1","layer2"); //your menu layers, not the topmenu layers (if you have some)!
if(i<10)
{i=i+1;}
tid=setTimeout("hiding()",timering*1000);
if(i==10)
{
clearTimeout(tid);
for(a=0;a<lay.length;a++)
{
if(document.layers)
{
document.layers[lay[a]].visibility="hidden";
}
else
{
document.getElementById(lay[a]).style.visibility="hidden";
}
}
}
}
//-->
</script>




and put into the submenu-div's for example:

<div id="Highschool" onMouseout="hiding()"

JohnnieCat
01-19-2003, 07:07 PM
Thanks Swon! I'll give that a try!