how to pass a variable in javascript?
Posted: Sun Jul 28, 2002 10:49 am
I think javascript is a bit same as PHP, so I write the code:
when my mouse over the link, the menu show up,but when my mouse out, the menu doesn't show down the menudown function doesn't work!
WHY?
Any idea?
Sorry for my english.
Code: Select all
<html>
<head>
<script language=JavaScript1.2>
function Show(divid) {
divid.filters.revealTrans.apply();
divid.style.visibility = "visible";
divid.filters.revealTrans.play();
}
function Hide(divid) {
divid.filters.revealTrans.apply();
divid.style.visibility = "hidden";
divid.filters.revealTrans.play();
}
function menudown(target){
setTimeout("Hide(target)",5000);
}
</script>
</head>
<body>
<!-- HERE, the link "HELP" -->
<a href="help.php" onMouseOver="Hide(lastdiv); document.lastdiv=help; Show(lastdiv);" onmouseout="menudown(help)">HELP!</a>
<div id="space" class=menu style="width: 0; height: 0; left: 0; top: 0"> </div>
<div id="help" class=menu style="left:658px; width: 75px;; top: 25px">
<table bgcolor=#000000 cellspacing=0 cellpadding=1>
<tr>
<td>
<table width=100% cellspacing=0 cellpadding=4 bgcolor=#dddddd>
<tr>
<td align="center"> <a href=abc.php>abc</a></td>
</tr>
<tr>
<td align="center"><a href=faq.php>faq</a></td>
</tr>
<tr>
<td align="center"><a href=about.php>about</a></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<script language=JavaScript1.2>
document.lastdiv=space;
</script>
</body></html>WHY?
Any idea?
Sorry for my english.