我想知道如何能夠在html中顯示一些文本幾秒鐘?我想在我的網站上加載一個標誌,顯示10秒鐘,然後離開。我怎麼能這樣做呢?我不經常使用HTML。帶有時間限制的HTML文本
代碼我想添加加載和Flash到。
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Catalog</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="590" id="AutoNumber1" height="32">
<tr>
<td width="320" height="77" bgcolor="#FFFFFF">
<p align="center"> <img border="0" src="images/logoblue.gif" width="307" height="61"></td>
<td width="380" height="77">
<p align="center"><b><font size="5">PRODUCTS, INC.<br>
</font></b><font size="4"></font></td>
</tr>
<tr>
<td width="590" height="10" bgcolor="#FFFFFF" colspan="2">
<img border="0" src="images/divid1.gif" width="700" height="10"></td>
</tr>
</table>
<p> </p>
<p>
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="842" height="539">
<param name="movie" value="catalog.swf">
<param name="quality" value="High">
<embed src="catalog.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="842" height="539"></object>
</p>
</body></html>
更新代碼Virendra的變化:一個更新的
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Catalog</title>
<style type='text/css'>
#swf_file{display:none;}
</style>
<script type='text/javascript'>
var timePeriodInMs = 20000;
setTimeout(function()
{
document.getElementById("texttohide").style.display = "none";
document.getElementById("swf_file").style.display = "block";
},
timePeriodInMs);
</script>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="590" id="AutoNumber1" height="32">
<tr>
<td width="320" height="77" bgcolor="#FFFFFF">
<p align="center"> <img border="0" src="images/logoblue.gif" width="307" height="61"></td>
<td width="380" height="77">
<p align="center"><b><font size="5">PRODUCTS, INC.<br>
</font></b><font size="4"></font></td>
</tr>
<tr>
<td width="590" height="10" bgcolor="#FFFFFF" colspan="2">
<img border="0" src="images/divid1.gif" width="700" height="10"></td>
</tr>
</table>
<div id="texttohide">
<img border="0" src="loading.gif" width="144" height="138"></div>
<div id="swf_file"><object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="842" height="539">
<param name="movie" value="catalog.swf">
<param name="quality" value="High">
<embed src="catalog.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="842" height="539"></object>
</div>
<p>
</p>
</body></html>
更新
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Catalog</title>
<style type='text/css'>
#swf_file{display:none;}
#swf_file{height:1px; width:1px;}
</style>
<script type='text/javascript'>
var timePeriodInMs = 10000;
setTimeout(function()
{
document.getElementById("texttohide").style.display = "none";
document.getElementById("swf_file").style.height = "138px";
document.getElementById("swf_file").style.width = "144px"; },
timePeriodInMs);
</script>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="590" id="AutoNumber1" height="32">
<tr>
<td width="320" height="77" bgcolor="#FFFFFF">
<p align="center"> <img border="0" src="images/logoblue.gif" width="307" height="61"></td>
<td width="380" height="77">
<p align="center"><b><font size="5">PRODUCTS, INC.<br>
</font></b><font size="4"></font></td>
</tr>
<tr>
<td width="590" height="10" bgcolor="#FFFFFF" colspan="2">
<img border="0" src="images/divid1.gif" width="700" height="10"></td>
</tr>
</table>
<div id="texttohide">
<b><font size="5">Loading for a few seconds...</font></b></div>
<div id="swf_file">
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="obj1" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="879" height="564">
<param name="movie" value="catalog.swf">
<param name="quality" value="High">
<embed src="catalog.swf" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="obj1" width="879" height="564"></object>
</div>
<p>
</p>
</body></html>
你將不得不使用JavaScript/jQuery的這一點。 – Virendra 2011-12-30 07:18:25
爲什麼你想要顯示一個恆定的10秒加載而不是等到它實際加載? – icktoofay 2011-12-30 07:18:55
你有密碼嗎? – Joseph 2011-12-30 07:18:58