Jump to content

Side Menu - Setinterval


Aviway
 Share

Recommended Posts

Hay,I try to make my side menu (that i build below) open every time i "onmouseover" it. and i did it with success.But now i want to make the mune open slowly with the "setInterval" method.How can i do it???This is the code:

<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"><html> <head>  <title> Side Menu </title>  <style>*{	padding:0;	margin:0;	}a{	text-decoration:none;	color:#000;	}#menu{	width:150px;	height:150px;	background-color: #ff99ff;	position:absolute;	top:50px;	left:-130px;	}#link{	text-align:center;	float:right;	font: bold 10pt arial; 	padding-top:50px;	padding-right:4px;	line-height:1;	}  </style>  <script language="JavaScript">  <!--	function openMenu()	{		var inx=1;		document.getElementById('menu').style.left=inx;		inx+=1;		if (inx>=0)inx=1;	}	function closeMenu()	{		document.getElementById('menu').style.left="-130px";	}  //-->  </script> </head> <body>	<a href="#" onmouseover="openMenu()" onmouseout="closeMenu()"><div id="menu">		<div id="link">			M<br>			E<br>			N<br>			U		</div>			</div></a>   </body></html>

Edited by Aviway
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
 Share

×
×
  • Create New...