本文主要是介绍焦点图效果 【jquery】,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
/*====焦点图效果*/
$(function() {
var len = $("#playbtn > li").length;
var index = 0;
var adTimer;
$("#playbtn li").mouseover(function() {
index = $("#playbtn li").index(this);
showImg(index);
}).eq(0).mouseover();
//滑入 停止动画,滑出开始动画.
$('#play').hover(function() {
clearInterval(adTimer);
}, function() {
adTimer = setInterval(function() {
showImg(index)
index++;
if (index == len) {
index = 0;
}
}, 3000);
}).trigger("mouseleave");
});
function showImg(index) {
这篇关于焦点图效果 【jquery】的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!