不知道错在了什么地方,麻烦好心的大虾帮我看一下

kiddy111 2004-10-15 05:07:20
照书做了个菜单随着鼠标移动的列子,运行的不对,找不到错误的原因,麻烦好心的大虾帮我看一下。感激!!!
<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>
...全文
145 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
kiddy111 2004-10-18
  • 打赏
  • 举报
回复
myid1.id的id对象不明
MooseWOler 2004-10-18
  • 打赏
  • 举报
回复
我记得不是window.event.srcElement吗?
MooseWOler 2004-10-18
  • 打赏
  • 举报
回复
obj=event.screlement;
姐姐哎看好,是scr?
pengqiaoli 2004-10-15
  • 打赏
  • 举报
回复
有错误提示的啊
错误提示是什么
说出来我就帮你改
kiddy111 2004-10-15
  • 打赏
  • 举报
回复
不是吧,这位好心的大虾认识这么多字,我会改的。谢了。还能在帮小妹我找找错么
tpf9000 2004-10-15
  • 打赏
  • 举报
回复
什么错啊?
{alert("清使用IE");
字写错了,哈哈哈

61,124

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧