/    Sign up×
Community /Pin to ProfileBookmark

Need hideDiv to go away onmouseout with timeout delay

[SIZE=”2″]Hey all,

It’s so nice to see so many folks helping eachother with changing web languages. Fairly new to all forms of web languages but am dabbling in HTML, CSS, Javascript and Flash. Got a javascript function (showDiv) that shows a labeled div onmouseover that are text intrapage links. Also have a (hideDiv) that hides it onmouseout. Those both work, I cannot for the life of me get the onmouseout or hideDiv to stay once moused out. I was searching and it seems the best method is the “setTimeOut” method, but just have no clue! Can anyone help?

What I have:

[B]JAVASCRIPT:[/B]

<script language=”Javascript”>
<!–

function showDiv(id) {
if (document.layers) document.layers[”+id+”].visibility = “show”
else if (document.all) document.all[”+id+”].style.visibility = “visible”
else if (document.getElementById) document.getElementById(”+id+”).style.visibility = “visible”
setTimeout(“hideDiv(id)”, 10000);
}
function hideDiv(id) {
if (document.layers) document.layers[”+id+”].visibility = “hide”
else if (document.all) document.all[”+id+”].style.visibility = “hidden”
else if (document.getElementById) document.getElementById(”+id+”).style.visibility = “hidden”
}

//–>
</script>

[B]CSS:[/B]

<style type=”text/css”>

body{
font-family: Arial, Helvetica, Sans-Serif;
background-color: #FDFFBC;}
a.intralink{
color: #656500;
font-size: 9pt;
font-weight: bold;
text-decoration: none;}
a.intralink:hover{
color: #FFFFFF;
background-color: #656500;
font-size: 9pt;
text-decoration: none;}
a.reglink{
color: #656500;
font-size: 10pt;
font-weight: bold;
text-decoration: none;}
a.reglink:hover{
color: #656500;
font-size: 10pt;
text-decoration: underline;}
div{
display: block;}

#div1, #div2, #div3, #div4{
visibility:hidden}

</style>

[B]Image Link to show other div and hide with delay:[/B]

<td width=”232″ valign=”middle”>

<div align=”center”>

<a href=”about.html”
onmouseover=”document.About.src=’Btn_About_over.gif’; showDiv(‘div1’);”
onmouseout=”document.About.src=’Btn_About_up.gif’; showDiv(‘div1’);”>

<img src=”Btn_About_up.gif”
name=”About”
alt=”About Us” border=”0″ width=”225″ />
</a>

</div>

</td>

Any help is greatly appreciated, Thanks![/SIZE][/SIZE][/SIZE]

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @noelsy 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.6,
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,
)...