秒跳转html代码,5秒定时跳转指定网页源码
【實例簡介】
【實例截圖】
【核心代碼】
頁面5秒跳轉源碼$(function() {
var h = $(window).height();
$('body').height(h);
$('.mianBox').height(h);
centerWindow(".tipInfo");
});
//2.將盒子方法放入這個方,方便法統一調用
function centerWindow(a) {
center(a);
//自適應窗口
$(window).bind('scroll resize',
function() {
center(a);
});
}
//1.居中方法,傳入需要劇中的標簽
function center(a) {
var wWidth = $(window).width();
var wHeight = $(window).height();
var boxWidth = $(a).width();
var boxHeight = $(a).height();
var scrollTop = $(window).scrollTop();
var scrollLeft = $(window).scrollLeft();
var top = scrollTop (wHeight - boxHeight) / 2;
var left = scrollLeft (wWidth - boxWidth) / 2;
$(a).css({
"top": top,
"left": left
});
}
請訪問臨時網址
頁面自動跳轉等待6秒
var wait = document.getElementById('wait'), href = document.getElementById('href').href;
var interval = setInterval(function() {
var time = --wait.innerHTML;
if (time <= 0) {
location.href = href;
clearInterval(interval);
}
;
}, 1000);
})();
總結
以上是生活随笔為你收集整理的秒跳转html代码,5秒定时跳转指定网页源码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: FTP云盘
- 下一篇: MODBUS通讯协议详解(基于485)