|
楼主 |
发表于 2006-12-17 00:06:49
|
显示全部楼层
那请看下段HTML代码吧
Post by quhan
我看到的效果是,鼠标移至“选择学校”时,下面换为很多学校的列表,移开无反应,
移至学生列表,无反应,单击,出现学生列表
[PHP]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
width:100px;
height:650px;
z-index:1;
background-color: #EFF8FE;
left: 240px;
top: 197px;
border-right:1px solid #57ACF2;
}
#Layer2 {
position:absolute;
width:635px;
height:650px;
z-index:1;
background-color: #EFF8FE;
left: 340px;
top: 197px;
}
#test {
position:absolute;
width:110px;
height:600px;
z-index:1;
background-color: #EFF8FE;
left: 860px;
top: 197px;
border-left:1px solid #57ACF2;
}
-->
</style>
<script>
function hidelayer2()
{
//var loEL = document.elementFromPoint(event.clientX,event.clientY);
//var aa=250;
//var aa=window.event.x;
//document.write(aa);
var oInterval = true;
if(oInterval==true)
{
oInterval = window.setInterval("fnRecycle()",3000); //1000毫秒
oInterval = false;
}
var aaa=null;
}
function fnRecycle(){
sid="Layer1";
whichEl = eval(sid);
eval(sid + ".style.display=\"none\";");
/*
sid2="Layer2";
whichEl = eval(sid2);
eval(sid2 + ".style.display=\"none\";");
*/
}
function getNews()
{
sid="Layer1";
whichEl = eval(sid);
eval(sid + ".style.display=\"\";");
}
</script>
</head>
<body >
<script>
function document.onmouseover(){
var loEL = document.elementFromPoint(event.clientX,event.clientY);
test.innerHTML = loEL.tagName;
aaa=null;
aaa=loEL.tagName;
//alert(aaa);
if(aaa=='DIV')
{
hidelayer2();
}
}
</script>
<div align="right" id="test" style="width:300;height:350;background:red;overflow:scroll">6666666666666</div>
<a href="#" onMouseOver="getNews()" class="blue"><strong>选择学校</strong></a>
<p>fffffffffffffffffffffffff</p>
<p> </p>
<p>eeeeeeeeeeeeeeeeeeeee</p>
<p> </p>
<p> </p>
<p>tttttttttttttttttt</p>
<div id="Layer1" style="display:none " ><a href='#' onMouseOver="getschool(1)" >安徽省</a><br><a href='#' onmouseover='getschool(2)' >北京市</a><br><a href='#' onmouseover='getschool(3)' >重庆市</a><br><a href='#' onmouseover='getschool(4)' >福建省</a><br><a href='#' onmouseover='getschool(5)' >甘肃省</a><br><a href='#' onmouseover='getschool(6)' >广东省</a><br><a href='#' onmouseover='getschool(7)' >广西</a><br><a href='#' onmouseover='getschool(8)' >贵州省</a><br><a href='#' onmouseover='getschool(9)' >海南省</a><br><a href='#' onmouseover='getschool(10)' >河北省</a><br><a href='#' onmouseover='getschool(11)' >黑龙江省</a><br><a href='#' onmouseover='getschool(12)' >河南省</a><br><a href='#' onmouseover='getschool(13)' >湖北省</a><br><a href='#' onmouseover='getschool(14)' >湖南省</a><br><a href='#' onmouseover='getschool(15)' >江苏省</a><br><a href='#' onmouseover='getschool(16)' >江西省</a><br><a href='#' onmouseover='getschool(17)' >吉林省</a><br>
<a href='#' onmouseover='getschool(18)' >辽宁省</a><br><a href='#' onmouseover='getschool(19)' >内蒙古自治区</a><br><a href='#' onmouseover='getschool(20)' >宁夏回族自治区</a><br><a href='#' onmouseover='getschool(21)' >青海省</a><br><a href='#' onmouseover='getschool(22)' >山东省</a><br><a href='#' onmouseover='getschool(23)' >山西省</a><br><a href='#' onmouseover='getschool(24)' >上海市</a><br><a href='#' onmouseover='getschool(25)' >四川省</a><br><a href='#' onmouseover='getschool(26)' >天津市</a><br><a href='#' onmouseover='getschool(27)' >陕西省</a><br><a href='#' onmouseover='getschool(28)' >新疆维吾尔自治区</a><br><a href='#' onmouseover='getschool(29)' >西藏自治区</a><br><a href='#' onmouseover='getschool(30)' >云南省</a><br><a href='#' onmouseover='getschool(31)' >浙江省</a><br></div>
</body>
</html>
[/PHP]
第一次运行的时候,将鼠标放到 DIV 里面的时候,就会激活" hidelayer2()"这个函数,但自从激活一次以后,这个函数就会一直运行,真到等你再刷新页面为止.
我的意思是不刷新页面就把变量 aaa销毁掉,我用aaa=null 好象不行 |
|