ultraman69
03-03-2005, 09:37 PM
Hi !
I'm fairly new to the wonderful world of javascript. I'm trying to build a dynamic menu based on sample code from a book I've bought. My question is, how can I make a sub menu (<table>) disapear on mouse out ? I tried putting my table in a <div> with onmouseout event, but it just won't work properly. :confused: What it does is it shuts the submenu when I leave the first row. Here's some code :
<DIV onmouseout="this.style.visibility='hidden'">
<table border=0 cellpadding=0 cellspacing=0>
<tr><td bgcolor='#ff00cc'
onMouseOver=this.style.background='#66ff88'
onMouseOut=this.style.background='#ff00cc'
height=20><font style='FONT-SIZE: 10pt'>Sub 1</font>
</td>
</tr>
<tr><td bgcolor='#ff00cc'
onMouseOver=this.style.background='#66ff88'
onMouseOut=this.style.background='#ff00cc'
height=20><font style='FONT-SIZE: 10pt'>Sub 2</font>
</td>
</tr>
</table>
I'm fairly new to the wonderful world of javascript. I'm trying to build a dynamic menu based on sample code from a book I've bought. My question is, how can I make a sub menu (<table>) disapear on mouse out ? I tried putting my table in a <div> with onmouseout event, but it just won't work properly. :confused: What it does is it shuts the submenu when I leave the first row. Here's some code :
<DIV onmouseout="this.style.visibility='hidden'">
<table border=0 cellpadding=0 cellspacing=0>
<tr><td bgcolor='#ff00cc'
onMouseOver=this.style.background='#66ff88'
onMouseOut=this.style.background='#ff00cc'
height=20><font style='FONT-SIZE: 10pt'>Sub 1</font>
</td>
</tr>
<tr><td bgcolor='#ff00cc'
onMouseOver=this.style.background='#66ff88'
onMouseOut=this.style.background='#ff00cc'
height=20><font style='FONT-SIZE: 10pt'>Sub 2</font>
</td>
</tr>
</table>