468,243 Members | 2,038 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,243 developers. It's quick & easy.

Menu hover using Javascript

Hello,

I have a menu in my web page, hovering on which it displays the
contents.
Its been constructed using <uland <litags.

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='no ne';
}
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>
<liContent 1 </li>
<liContent 1 </li>
</ul>
</dd>

Can anyone help me out this? Its urgent !!

Jul 6 '06 #1
1 1707
You can disable the visibility of a block by setting its css properties.

<span style="display:none; visibility: hidden;">Hidden layer</span>
Vani Kulkarni wrote:
Hello,

I have a menu in my web page, hovering on which it displays the
contents.
Its been constructed using <uland <litags.

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='no ne';
}
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>
<liContent 1 </li>
<liContent 1 </li>
</ul>
</dd>

Can anyone help me out this? Its urgent !!
Jul 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by unurban | last post: by
2 posts views Thread by hemanth.singamsetty | last post: by
2 posts views Thread by Ravi Joshi | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.