不知道错在了什么地方,麻烦好心的大虾帮我看一下
照书做了个菜单随着鼠标移动的列子,运行的不对,找不到错误的原因,麻烦好心的大虾帮我看一下。感激!!!
<html>
<head>
<title>单</title>
<meta content="text/html; charset=gb2312" http-equiv=Content-Type>
<meta content="MSHTML 5.00.2919.6307" NAME=GENERATOR>
<STYLE TYPE="TEXT/css">
a:link{
color:yellow;
background:green;
cursor : hand ;
text-decoration: none
}
a:hover{
color:red;
background:yellow;
cursor : hand ;
text-decoration: none
}
a:visited{
color:yellow;
background:green;
cursor : hand ;
text-decoration:none
}
#myid1{
position:absolute;
background-color:green;
color:yellow;
top: 10 ;
left: 10 ;
width: 50 ;
height : 60 ;
z-index:5 ;
border-width : 2;
visibility:visible
}
</style>
<script language=javascript>
function takeclick()
{
var obj;
obj=event.screlement;
if(obj.id=="myid1")
{return;
}
else{
var posx
var posy;
posx=event.x+document.body.scrollleft;
posy=event.y+document.body.scrolltop;
if (myid1.style.visibility=="visible")
{
myid1.style.visibility="hidden";
}
else {
myid1.style.left=posx;
myid1.style.top=posy;
myid1.style.visibility="visible";
}
return;
}
}
function change(n)
{
if(n==1)
{document.body.bgcolor="yellow";
return;
}
if(n==2)
{document.body.bgcolor="black";
return;
}
if(n==3)
{document.body.bgcolor="blue";
return;
}
}
</script>
</head>
<body>
<p align="center">
<font face="Times New Roman" size="6" color="red">
单击<br>
</font>
<font face="Times New Roman" size="4" color="red">
欢迎<br>
欢迎<br>
欢迎<br>
</font>
<div id="myid1">
<a href="javascript:change(1)">
黄色
</a><br>
<a href="javascript:chang(2)">
黑色
</a><br>
<a href="javascript:chang(3)">
蓝色
</a>
</div>
<script language=javascript>
var isIE;
if(document.all)
{isIE=true;
}
else{isIE=false;
}
if(!isIE)
{alert("清使用IE");
}
else{
myid1.style.left=10;
myid1.style.top=10;
myid1.style.visibility="hidden";
document.body.onclick=takeclick;
}
</script>
</body>
</html>