當(dāng)你做網(wǎng)頁時(shí),是不是有的時(shí)候想讓你的網(wǎng)頁自動(dòng)不停刷新,或者過一段時(shí)間自動(dòng)跳轉(zhuǎn)到另外一個(gè)你自己設(shè)定的頁面?
其實(shí)實(shí)現(xiàn)這個(gè)效果非常地簡單,而且這個(gè)效果甚至不能稱之為特效。你只要把如下代碼加入你的網(wǎng)頁中就可以了。
1.頁面自動(dòng)刷新:把如下代碼加入<head>區(qū)域中
<meta http-equiv="refresh" content="20">,其中20指每隔20秒刷新一次頁面.
2.頁面自動(dòng)跳轉(zhuǎn):把如下代碼加入<head>區(qū)域中
<meta http-equiv="refresh" content="20;url=http://www.yibo1263.com">,其中20指隔20秒后跳轉(zhuǎn)到http://www.yibo1263.com頁面
3.頁面自動(dòng)刷新js版
<script language="JavaScript"> function myrefresh(){ window.location.reload(); } setTimeout('myrefresh()',1000); //指定1秒刷新一次 </script> |