/    Sign up×
Community /Pin to ProfileBookmark

Dynamic Display of div tag onMouseOut hides it to quick

[url]http://www.michaelrparker.biz/index2.php[/url]

I am looking to make a dynamic menu, so that when user hovers over it, a new menu appears in a previously hidden div tag.

When you hover over “Dynamic Web Solutions” the div tag shows, but once you point your mouse on the showing div tag, its “onMouseOut” function gets called before you can hang out on the div tag long enough to look at its menu options.

Any ideas for making the div tag remain for a freindlier amount of time?

[code]

<td onMouseOver = showDiv(‘main1’) style=”width:13em;”>
<li style=”width:13em;” >Dynamic Web Solutions
</li></td>
<td style=”width:13em;”>
<div id=’main1′ class=’hiddenDiv’ style=”width:13em; height:10em; border:thin red solid;” onMouseOut=hideDiv(‘main1′) >
<ol><li><a href=’#’>1</a></li><li><a href=’#’>2</a></li>
</ol></div></td>
</tr>
</table>

[/code]

[code]
function showDiv(objID)
{
var s=document.getElementById(objID);
if(!s){return;}

s.className=’showDiv’;

}

function hideDiv(objID)
{

var h=document.getElementById(objID);
if(!h){return;}

h.className=’hiddenDiv’;

}
[/code]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@konithomimoJan 05.2007 — Place the hidden div that appears inside of the outer div. That will result in your still being over the outer div, so the onmouseout method will not be called. or in the onmouseout method check to see if the other div is in focus. if it is then dont close the first div.
Copy linkTweet thisAlerts:
@mparker1113authorJan 06.2007 — the bottom corner or right side of the link that it is referring to.

I could use some input. any good example code out there for a pop-up menu using javascript and css ? should i be trying to do this in flash instead of javascript?

Some of the code that I have tried for this is:

<i>
</i>
&lt;p style="border:thin blue solid; vertical-align:top;" &gt;
&lt;ul &gt;

&lt;span style="width:13em; border:thin blue solid;" onMouseOver = showDiv('main1')&gt;Dynamic Web Solutions &lt;/span&gt;
&lt;div id='main1' class='hiddenDiv' style="width:13em; height:10em; border:thin red solid; position:relative; top:-66;right:55; z-index:5;" onMouseOver = showDiv('main1') onMouseOut=hideDiv('main1') &gt;
&lt;ol&gt;&lt;li&gt;&lt;a href='#'&gt;1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='#'&gt;2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='#'&gt;3&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href='#'&gt;4&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;

&lt;/ul&gt;
&lt;/p&gt;




The page is at: http://michaelrparker.biz/index2.php

And is probably going to be changed in two seconds when I try to find a solution.
Copy linkTweet thisAlerts:
@bathurst_guyJan 06.2007 — There are some good CSS menus at cssplay.co.uk
×

Success!

Help @mparker1113 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...