全屏无缝滚动加透明遮罩效果,支持IE10以上版本浏览器
没有实现自动播放的看这里,我自己修改了一下,实现自动播放加鼠标经过暂停。直接加到index.js最后面就行了。
var int = null;
$(".bannerBut ul li").hover((function() {
window.clearInterval(int);
$(this).addClass('hover').siblings('li').removeClass('hover');
var _index1 = $(this).index();
$('.bannerCon .scroll').stop().animate({
left: -_index1 * 750
}, 500);
}), (function() {
int = self.setInterval("auto_play()", 2500);
}));
int = self.setInterval("auto_play()", 2500);
function auto_play() {
_index1++;
if (_index1 > 9) {
_index1 = 1;
$('.scroll').css('left', '0px');
$('.scroll').animate({
left: -_index1 * 750
}, 500);
$('.bannerBut ul li').eq(_index1).addClass('hover').siblings('li').removeClass('hover');
} else {
$('.bannerBut ul li').eq(_index1).addClass('hover').siblings('li').removeClass('hover');
$('.scroll').animate({
left: -_index1 * 750
}, 500);
}
}