日期:2014-05-16  浏览次数:20372 次

简单的问题```
<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)
}