422,904 Members | 1,030 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,904 IT Pros & Developers. It's quick & easy.

Menu hover using Javascript

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.