var Fpic = $(".banner li");
var Lpic = Fpic.find("img");
//图片自适应浏览器窗口大小
var winW, winH;
function findSize() {
if (window.innerHeight && window.innerWidth) {
winW = window.innerWidth;
winH = window.innerHeight;
}
if (document.documentElement.clientHeight && document.documentElement.clientWidth) {
winW = document.documentElement.clientWidth;
winH = document.documentElement.clientHeight;
}
if (document.body.clientHeight && document.body.clientWidth) {
winW = document.body.clientWidth;
winH = document.body.clientHeight;
}
Lpic.css({ "width": winW, "height": winH });
}
window.onload = findSize;
window.onresize = window_resize;
var resizeTimeoutId;
function window_resize(e) {
window.clearTimeout(resizeTimeoutId);
resizeTimeoutId = window.setTimeout('findSize();', 100);
}
//图片轮播动画
var FpicNum = Fpic.length;
Fpic.eq(0).fadeIn();
var now = 0;
setInterval(function () {
if (now >= FpicNum - 1) {
Fpic.eq(FpicNum - 1).stop().fadeOut(500);
now = -1;
}
Fpic.eq(now).stop().fadeOut(500);
now++;
Fpic.eq(now).stop().fadeIn(500);
}, 3000);