首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

简单的有关问题`

2012-02-05 
简单的问题```htmlheadmetahttp-equiv Content-Type content text/htmlcharsetgb2312 /tit

简单的问题```
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 "   />
<title> 1秒消失 </title>
<script   language= "javascript ">
function   he(o)
{
setTimeout( "jin( "+o+ ") ",1000)
}
function   jin(o)
{
o.style.display= "none ";
}
</script>
</head>
<body>
<div     onclick= "he(this) "> dsf </div>
</body>
</html>

我想点   字后   1秒种消失       为什么没用啊``

[解决办法]
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 1 </title>
<script language= "javascript ">
var obj;
function he(o)
{
obj=o;
setTimeout( "jin() ",1000)
}
function jin()
{
obj.style.display= "none ";
}
</script>
</head>
<body>
<div onclick= "he(this) "> dsf </div>
</body>
</html>
[解决办法]
function he(o)
{
window.o=o
setTimeout( "jin(o) ",1000)
}

热点排行