有人要这样的效果 ,就是打开站点后先看到一张图,然后再自动转向站点,打开站点的主要内容。
我当时的设想就是利用延时转向文件,再加张图,经过试验行了。
   下面贴上我的代码吧,第一种是利用index.htm文件设置它的自动跳转,代码如下:

引用

<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>欢迎访问本站,跳转进行中……</title>
</head>
 <script> 
var bar=0 
var line="&#124;&#124;" 
var amount="&#124;&#124;" 
count() 
function count(){ 
bar=bar+2 
amount =amount + line 

if (bar<99) 
{setTimeout("count()",50);} 
else 
{window.location = "index.php";} 
}</script>

<body>

<div align="center"><img src="Snap1.jpg" alt="" align="absmiddle" width="960" height="530"  longdesc="index.php"> </div>
</body>
</html>


图片就截成960*530,跳转等待时间为5秒。
经测试成功,可是他的空间不支持htm没办法,只能做成php的,把它命名为default.php,并在空间管理上把default.php设为首个搜索页,代码如下:
引用

<?php
echo "<html>\n";
echo "<head>\n";
echo "<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 5.0\">\n";
echo "<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">\n";
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\n";
echo "<title>欢迎访问本站,跳转进行中……</</title>\n";
echo "</head>\n";
echo "  <script>  \n";
echo "var bar=0  \n";
echo "var line=\"&#124;&#124;\"  \n";
echo "var amount=\"&#124;&#124;\"  \n";
echo "count()  \n";
echo "function count(){  \n";
echo "bar=bar+2  \n";
echo "amount =amount + line  \n";
echo " \n";
echo "if (bar<99)  \n";
echo "{setTimeout(\"count()\",50);}  \n";
echo "else  \n";
echo "{window.location = \"index.php\";}  \n";
echo "}</script> \n";
echo "\n";
echo "<body>\n";
echo "\n";
echo " <div align=\"center\"><img src=\"0000.jpg\" alt=\"\" align=\"absmiddle\" width=\"960\" height=\"530\"  longdesc=\"index.php\"> </div>\n";
echo "</body>\n";
echo "</html>\n";
echo "";
?>

想达到此效果的朋友可以用下哈……
» | 评论(0) | 引用(0) | 阅读(1009)