flash自动隐藏
setTimeout("myDiv.style.display='none'",30000)
来控制其运行30秒钟后自动隐藏,但FLASH里面的音乐还会不断地播放,要怎么写才能连声音一起关掉呢
用一个JS函数就可以搞定了
setTimeout("调用function hideflash ",30000)
function hideflash()
{
myDiv.style.display='none'
myDiv.flash_MovieClip_ID.StopPlay()//把flash停掉
}
html-五秒后自动隐藏div块
<head>
<script language="javascript" type="text/javascript">
function closediv()
{
document.getElementById("hidediv").style.visibility="hidden";
}
</script>
</head>
<body onload="setTimeout('closediv()',5000)">
<div id="hidediv" style="visibility:visible">ok</div>
</body>
</html>
另一个例子
<style>
#div{
display:none;
width:200px;
height:200px;
background:#999;
border:1px solid #333;
}
</style>
<script>
window.onload=function(){
setTimeout(function(){
document.getElementById("div").style.display="block";
},5000);
}
</script>
<body>
<div id=div></div>
</body>