Jump to content

question about menu code


NeoSniperkiller

Recommended Posts

Hello,Can anyone tell me (or show me) what I must modify in this code, so it would work for multiple elements.It currently works only for 1 element.

<script type="text/javascript">var i=-135var intHidevar speed=3function showmenu(){clearInterval(intHide)intShow=setInterval("show()",10)}function hidemenu(){clearInterval(intShow)intHide=setInterval("hide()",10)}function show(){if (i<-12){	i=i+speed	document.getElementById('myMenu').style.left=i	}}function hide(){if (i>-135){	i=i-speed	document.getElementById('myMenu').style.left=i	}}</script>

Thanks in advance

Link to comment
Share on other sites

Well, why do you have showmenu setting a timer interval to call function show? Why would you want it to call that function every 10 milliseconds (10/1000th of a second, or 1/100th) to show it.. you would only need to call show and thats it..

Link to comment
Share on other sites

Well, why do you have showmenu setting a timer interval to call function show? Why would you want it to call that function every 10 milliseconds (10/1000th of a second, or 1/100th) to show it.. you would only need to call show and thats it..
i could show it to ya in here, but i dont think the tags are allowedthis timeinterval makes the menu slowly appear, kinda sliding out not enabled :) ok to see the menu go to this page, its a page from w3schoolsSliding menu
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...