jQuery自動(dòng)切換/點(diǎn)擊切換選項(xiàng)卡效果的小例子
更新時(shí)間:2013年08月12日 11:53:53 作者:
我們看到很多網(wǎng)站會(huì)有有錯(cuò)誤404頁面,當(dāng)頁面不存存時(shí)就會(huì)提示,然后過幾秒就會(huì)自動(dòng)跳到首頁了,下面我來給大家舉一個(gè)404錯(cuò)誤頁面跳到首頁實(shí)例,有需要的朋友可以參考一下
復(fù)制代碼 代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>404 Not Found</title>
</head>
<body>
<h1>找不到指定的頁面</h1>
<span id="totalSecond">3</span>秒后自動(dòng)返回
</body>
<script language="javascript" type="text/javascript">
<!--
var second = document.getElementById('totalSecond').textContent;
if (navigator.appName.indexOf("Explorer") > -1) //判斷是IE瀏覽器還是Firefox瀏覽器,采用相應(yīng)措施取得秒數(shù)
{
second = document.getElementById('totalSecond').innerText;
} else
{
second = document.getElementById('totalSecond').textContent;
}
setInterval("redirect()", 1000); //每1秒鐘調(diào)用redirect()方法一次
function redirect()
{
if (second < 0)
{
location.href = 'http://要跳轉(zhuǎn)的網(wǎng)站';
} else
{
if (navigator.appName.indexOf("Explorer") > -1)
{
document.getElementById('totalSecond').innerText = second--;
} else
{
document.getElementById('totalSecond').textContent = second--;
}
}
}
-->
</script>
</html></td>
</tr>
</table>
您可能感興趣的文章:
- Jquery實(shí)現(xiàn)點(diǎn)擊切換圖片并隱藏顯示內(nèi)容(2種方法實(shí)現(xiàn))
- 基于jquery實(shí)現(xiàn)左右按鈕點(diǎn)擊的圖片切換效果
- jquery點(diǎn)擊縮略圖切換視頻播放特效代碼分享
- jquery插件jquery.LightBox.js實(shí)現(xiàn)點(diǎn)擊放大圖片并左右點(diǎn)擊切換效果(附demo源碼下載)
- jquery實(shí)現(xiàn)圖片放大點(diǎn)擊切換
- jquery點(diǎn)擊切換背景色的簡單實(shí)例
- 使用jQuery實(shí)現(xiàn)鼠標(biāo)點(diǎn)擊左右按鈕滑動(dòng)切換
- Jquery幻燈片特效代碼分享?鼠標(biāo)點(diǎn)擊按鈕時(shí)切換(1)
- jQuery實(shí)現(xiàn)切換字體大小的方法
- jQuery實(shí)現(xiàn)的點(diǎn)擊標(biāo)題文字切換字體效果示例【測試可用】
相關(guān)文章
jQuery向webApi提交post json數(shù)據(jù)
這篇文章主要介紹了jQuery向webApi提交post json數(shù)據(jù)的方法,非常不錯(cuò),需要的的朋友參考下2017-01-01
基于jQuery實(shí)現(xiàn)最基本的淡入淡出效果實(shí)例
這篇文章主要介紹了基于jQuery實(shí)現(xiàn)最基本的淡入淡出效果的方法,實(shí)例分析了jQuery中hide、show、toggle等函數(shù)的使用技巧,需要的朋友可以參考下2015-02-02
Jquery通過ajax請求NodeJS返回json數(shù)據(jù)實(shí)例
本篇文章主要是介紹Jquery通過ajax請求NodeJS返回json數(shù)據(jù),具有一定的參考價(jià)值,有需要的可以了解一下。2016-11-11

