各大门户,大家可能都发现了.刚打开网页时.都会出来一个很大的flash广告.过一段时间就自己消失了.又回到正常的内容.本文就是要为大家介绍这种效果的实现方式.

直接看以下代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>flash广告延迟-网站制作教程网</title>
<style type="text/css">
<!--
body,html {height:100%;
}
#flash{top:10%;left:10%;width:520px;height:300px;background:#cc3300;POSITION: absolute;}
-->
</style>
</head>
<body>
<div id="flash">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="520" height="320">
<param name="movie" value="http://www.webjx.com/js/focus.swf" />
<param name="quality" value="high" />
<embed src="http://www.webjx.com/js/focus.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="32" height="32"></embed>
</object>
</div>
<p><strong>中新网11月9日电</strong> 内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容:</p>
<p>1、内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容。</p>
<p>2、内容内容内容内容内容内容内容内容内容内容内容内容月,以第一个月为休假日)。</p>
<p>3、内容内容内容内容内容内容内容内容<p>
<p>内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容</p>
<script language="javascript">
setTimeout("document.getElementById('flash').style.display='none'",5000)  //因为延迟,由8秒改成13秒
setTimeout("document.getElementById('flash').style.display=''",10);
</script>
</body>
</html>