请教一个javascript效果。 style="display: none" + setTimeout 应该可以实现 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <HTML><HEAD><SCRIPT LANGUAGE="JavaScript">function display(){ c1 = document.getElementById('c1') ; setTimeout( 'c1.style.display = "none"', 3000);}</SCRIPT></head> <body onload=display()><form name="form1" method="post" action=""> <input type="button" name="Submit" id="c1" value="按钮"></form></body></html> 多谢!为什么我改成:<HTML><HEAD><SCRIPT LANGUAGE="JavaScript">function display(){ c1 = document.getElementById('c1') ; setTimeout( 'c1.style.display = "none"', 3000);}</SCRIPT></head> <body onload=display()><table id="c1"><tr><td>fdsa</td></tr></table></body></html>不会有效果呢? <HTML><HEAD><SCRIPT LANGUAGE="JavaScript">function display(){ setTimeout( 'c1.style.display = "none"', 3000);}</SCRIPT></head> <body onload=display()><table id="c1"><tr><td>fdsa</td></tr></table></body></html> <HTML><HEAD><SCRIPT LANGUAGE="JavaScript">function display(){ c1 = document.getElementById('c1') ;setTimeout( 'c1.style.display = "none"', 3000);}</SCRIPT></head> <body onload=display()><form name="form1" method="post" action=""><img src="111.jpg" id="c1"></form></body></html> 非常感谢!顺便再问问document.getElementById('c1')这一句是什么意思?为什么对form和img元素都起作用,而对table却不起作用呢?请教!谢谢! <HTML><HEAD><SCRIPT LANGUAGE="JavaScript">function display(){ var c2 = document.getElementById('c1') ; //alert(c2.style.display==""); if(c2.style.display=="") c2.style.display="none"; else c2.style.display=""; window.setTimeout(display, 500);}</SCRIPT></head> <body onload=display()><table id="c1" style="display:"><tr><td><font color="blue"><b>code by meixx</b></font></td></tr></table></body></html> <HTML><HEAD><SCRIPT LANGUAGE="JavaScript"><!--function mhide(){document.getElementById('c1').style.display='none';}//--></SCRIPT></head> <body><form name="form1" method="post" action=""><img src="111.jpg" id="c1"></form><script>setTimeout('mhide',3600);</script></body></html> JavaScript如何获得某一天的前一天日期 请教高手 达人换行功能的实现 类似QQ群论坛里面的回帖 当回帖成功弹出的效果 怎么用JS实现啊 请问下面语句是什么意思? IE6的问题 求javascript utf 16转gb2312的代码 【散分】分子有点多了,随便散一点吧--顺便发一个改造了的仿163的弹出框 Ext Js4 grid不显示数据 jqplot插件 这种效果如何时实现 如何动态的改变分桢的大小? 在用JS实现实时计算的时候,为什么会出现对话框,提示"栈溢出"? javascript怎末连接Access数据库?还有增删改功能?
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function display(){
c1 = document.getElementById('c1') ;
setTimeout( 'c1.style.display = "none"', 3000);
}</SCRIPT>
</head>
<body onload=display()>
<form name="form1" method="post" action="">
<input type="button" name="Submit" id="c1" value="按钮">
</form>
</body>
</html>
为什么我改成:
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function display(){
c1 = document.getElementById('c1') ;
setTimeout( 'c1.style.display = "none"', 3000);
}
</SCRIPT>
</head>
<body onload=display()>
<table id="c1">
<tr><td>fdsa</td></tr>
</table>
</body>
</html>
不会有效果呢?
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function display(){
setTimeout( 'c1.style.display = "none"', 3000);
}
</SCRIPT>
</head>
<body onload=display()>
<table id="c1">
<tr><td>fdsa</td></tr>
</table>
</body>
</html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function display(){
c1 = document.getElementById('c1') ;
setTimeout( 'c1.style.display = "none"', 3000);
}</SCRIPT>
</head>
<body onload=display()><form name="form1" method="post" action="">
<img src="111.jpg" id="c1">
</form>
</body>
</html>
顺便再问问document.getElementById('c1')这一句是什么意思?为什么对form和img元素都起作用,而对table却不起作用呢?
请教!谢谢!
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function display(){
var c2 = document.getElementById('c1') ;
//alert(c2.style.display=="");
if(c2.style.display=="")
c2.style.display="none";
else
c2.style.display="";
window.setTimeout(display, 500);
}
</SCRIPT>
</head>
<body onload=display()>
<table id="c1" style="display:">
<tr><td><font color="blue"><b>code by meixx</b></font></td></tr>
</table>
</body>
</html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function mhide(){
document.getElementById('c1').style.display='none';
}
//-->
</SCRIPT>
</head>
<body><form name="form1" method="post" action="">
<img src="111.jpg" id="c1">
</form>
<script>setTimeout('mhide',3600);</script>
</body>
</html>