Forum Moderators: open
What's going wrong?
<script language="JavaScript">
function show(object) {
if (document.layers && document.layers[object])
document.layers[object].visibility = 'visible';
else if (document.all) {
document.all[object].style.visibility = 'visible';
document.all[object].style.zIndex = 100;
}
}
function hide(object) {
if (document.layers && document.layers[object])
document.layers[object].visibility = 'hidden';
else if (document.all)
document.all[object].style.visibility = 'hidden';
}
</script>
<a href="#" onMouseOver="show('myId')" onMouseOut="hide('myId')">LINK</a>
<div id="myId" style="position:relative; width:200px; z-index:1; visibility: hidden; left: 0px; top: 10px">
<table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td align="center">Hello World...</td>
</tr>
</table></div>
Any ideas?
<script type="text/javascript">
function show(object,val) {
document.getElementById(object).style.visibility = val;
}
</script><a href="#" onMouseOver="show('myId','visible')" onMouseOut="show('myId','hidden')">LINK</a>
By the way, I've found that including the window in the scope chain of a method improves the chances of cross-browser success.