Menu hover using Javascript

V

Vani Kulkarni

Hello,

I have a menu in my web page, hovering on which it displays the
contents.
Its been constructed using <ul> and <li> tags.

The problem is that the menu appears on page load which i dont it to
happen. I want the menu to be appeared only if I hover the mouse on it.

Here is the code i have written :

<script type="text/javascript" language="JavaScript1.2">
function menuHover(id)
{
var d = document.getElementById(id);
if (document.getElementById('menu1'))
{

document.getElementById('menu1').style.display='none';
}
if (d)
{
d.style.display='block';
}
}
</script>

<dt onmouseover="menuHover('menu1');" onmouseout="menuHover('');">
<img src="/images/images.gif" id="image_view" runat="server">
</dt>
<dd id="menu1" onmouseover="menuHover('menu1');"
onmouseout="menuHover('');">
<ul>
<li> Content 1 </li>
<li> Content 1 </li>
</ul>
</dd>

Can anyone help me out this? Its urgent !!
 
V

Vincent van Beveren

You can disable the visibility of a block by setting its css properties.

<span style="display:none; visibility: hidden;">Hidden layer</span>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top