onmouseover
我有一个脚本可以在两个由事件触发的弹出窗口之间切换。其中一个特点是弹出窗口一直持续到下一个onmouseover
事件。我想要其中很多,因此要隐藏的弹出窗口不能像我的脚本中那样“硬编码”。有没有办法将下次调用弹出函数时需要不显示的弹出窗口的 id 存储在变量中?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript">
function popup(show,hide){
show.style.display="block"
hide.style.display="none"
}
</script>
<style type="text/css">
.pop {
position: absolute;
display: none;
top: 50px;
left: 200px;
width: 300px;
}
</style>
</head>
<body>
<table><tr>
<td onmouseover="popup(pop1,pop2)">Show popup 1</td>
<td onmouseover="popup(pop2,pop1)">Show popup 2</td>
</tr></table>
<div class="pop" id="pop1">This is popup 1</div>
<div class="pop" id="pop2">Popup 2 is here</div>
</body>
</html>
或访问http://www.salemharvest.org/Utilities/TestingPHP/testingpopupdivs5.php