Whitey said:
Now if you did OnMouseOut and OnMouseOver using this it just push's the other text down.. So is there a way to use this for a drop down menu?
Yeah you can simply change the position of the content to absolute so it goes over the text
toxifyshadow said:
Sorry if this is off-topic, is there a way to make a drop down menu with links as options?
Yes, all you do is add a <a href="http://forum.codecall.net/javascript/..."> Link </a> to any link you want to make.
I slightly modified the code to show the two concepts asked about above. And you can make this menu very complex if you want to, just need some simple coding :)
<html>
<head>
<script type="text/javascript">
function drop(id) {
if (document.getElementById(id).style.display == 'block') {
document.getElementById(id).style.display = 'none';
} else {
document.getElementById(id).style.display = 'block';
}
}
</script>
</head>
<body>
<a onclick="drop(1)">TEXT TO CLICK</a> <br />
<div id="1" style="display:none;[B]position:absolute[/B]">
[B]CONTENT IN THE DROP-DOWN MENU <br />
<a href="http://www.codecall.net">Link 1 </a><br />
<a href="http://www.codecall.net">Link 2 </a><br />[/B]
</div>
<p>Hello Everyone</p>
</body>
</html>
My modifications are in bold. Oh and sorry if im not allowed to modify the code posted by the original author or anything like that...