/    Sign up×
Community /Pin to ProfileBookmark

setInterval to hide menu

I’m having some trouble hidding the submenu after a mouse rollout, here’s my code

<script type=”text/javascript” language=”javascript1.2″>
<!–
//Check to see if this is a navigator browser
if(navigator.userAgent.indexOf(“MSIE”) == -1){
alert(“Built for Internet Explorer”);
window.back();
}

//declare global variables
var layer = new String();
var style = new String();

//Set the layer and style variables
function checkBrowser(){
layer = “.all”;
style = “.style”;
}

//remove on rollout
function secondsLeft(mePlease){
timeout = setInterval(“changeState(‘” + mePlease + “‘, ‘hidden’)”, 10000);
}

//Take the state passed in, and change it
function changeState(layerRef, state){
clearInterval(timeout);
eval(“document” + layer + “[‘” + layerRef + “‘]” + style + “.visibility = ‘” + state + “‘”);
}

//–>
</script>
<div name=”products” id=”products”><a href=”products.aspx” onMouseOver=”changeState(‘usMenu’, ‘hidden’); changeState(‘productsMenu’, ‘visible’); changeState(‘warrantyMenu’, ‘hidden’); changeState(‘classesMenu’, ‘hidden’)”><img border=”0″ src=”imagery/interface/menu/products_img.gif”></a></div>

please help me.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@myEMYCauthorFeb 17.2005 — I need it to hide the submenu after a certain amount of time. does anyone know how to accomplish this. thanks.
×

Success!

Help @myEMYC 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...