/    Sign up×
Community /Pin to ProfileBookmark

Help with onmouseout command.

Hi everyone, I need some help.

Here’s the thing;

I’m making a kind of drop-down menu and it’s not working quite as I would like. If you trust me you could check out this adress to see the thing I doing: [URL=”http://horseballs.mine.nu/test/test.hmtl”]http://horseballs.mine.nu/test/test.hmtl[/URL]

These are the main code:

[CODE]<script type=”text/javascript”>

//show function
function showmenu(elmnt)
{
document.getElementById(elmnt).style.visibility=”visible”
}

// hide function
function hidemenu(elmnt)
{
document.getElementById(elmnt).style.visibility=”hidden”
}

// delay function
function delayhidemenu()
{
setTimeout(“hidemenu()”, 500);
}

<td class=”start” onmouseover=”showmenu(‘crew’)” onmouseout=”delayhidemenu(‘crew’)” bgcolor=”#000000″>
</script>

[/CODE]

Now, if I just write: onmouseout=”hidemenu(‘crew’)” ; the menu hides, but it hides instantly and thats not what I would like.
I would like to know what I messed up in the ‘delayhidemenu’ function.

Any help is very appriciated. If you need more information about this, just pm me or post here.

Thanks in before hand,

Eric.

to post a comment
Full-stack Developer

2 Comments(s)

Copy linkTweet thisAlerts:
@patudzuOct 12.2007 — Hi.

Try this solution and see if this is what you want.

[CODE]<script type="text/javascript">
//show function
function showmenu(elmnt)
{
document.getElementById(elmnt).style.visibility="visible";
}

// hide function
function hidemenu(elmnt)
{
document.getElementById(elmnt).style.visibility="hidden";
}

// delay function
function delayhidemenu(elmnt) {
var intervalo = window.setTimeout("hidemenu('"+elmnt+"')", 5000);
}

</script>[/CODE]



And...

[code=html]<td class="start" onmouseover="showmenu('crew')" onmouseout="delayhidemenu('crew')" bgcolor="#000000">
<IMG src="http://horseballs.mine.nu/test/crewb.jpg" border=0>[/code]
Copy linkTweet thisAlerts:
@QuidamauthorOct 12.2007 — Thanks alot!

That worked just as I liked.

Really nice with a good and fast reply like that, thanks. ?

-edit- typo
×

Success!

Help @Quidam 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.19,
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,
)...