Jump to content

Sliding menu question


Verlepte

Recommended Posts

I have a question about the sliding menu function. What I want is for the menu to slide in when the page loads, not when you click/mouseover somewhere. So in the w3schools.com tryit editor I change the sliding menu code to the following:

<html><head><style>body{font-family:arial;}a{color:black;text-decoration:none;font:bold}a:hover{color:#606060}div.blok{position:fixed;top:100px;left:0px;background:white;width:105px;height:150px}td{background:#000000}		table.nummers		{		width:20%;		height:25%;		position:fixed;		top:105px;		background:#000000;		color:#FFFFFF;		border:#003300 solid 2px;		text-align:left;		font-size:12pt;		font-variant:small-caps;		-moz-opacity:0.75;		z-index:-3		}</style><script type="text/javascript">var i=-300var speed=3function showmenu(){intShow=setInterval("show()",10)}function show(){if (i<110)	{	i=i+speed	document.getElementById('beweeg').style.left=i	}}</script></head><body onload="showmenu()">	    <table id="beweeg" class="nummers" width="300">	    <tr>	    <td>	    Titel1<br />	    Titel2<br />	    Titel3<br />	    Titel4<br />	    Titel5<br />	    Enz...	    </td>	    </tr>	    </table><div class="blok"></div></body></html>

Now, this works fine in the tryit editor itself, but when I use the script on my website it won't work. Even if I copy/paste this whole html code to a separate html-file and load that in firefox it doesn't work. So, where am I going wrong? Thanks for your time...

Link to comment
Share on other sites

well, I've found the problem: the z-index! I didn't realise the body had a z-index of 0 that is impossible to change (at least, giving the body a lower negative z-index value didn't work,) so the menu that was supposed to come sliding in was hidden by the background-colour of the body...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...