【发布时间】:2012-03-23 22:14:17
【问题描述】:
这里是代码:http://jsfiddle.net/VW8V5/1/
悬停时它应该开始循环,但循环结束时它只显示 img3 和 img4(将 img3 循环到 img4),它应该从头开始。悬停时它应该停在 img1。
【问题讨论】:
标签: jquery jquery-plugins
这里是代码:http://jsfiddle.net/VW8V5/1/
悬停时它应该开始循环,但循环结束时它只显示 img3 和 img4(将 img3 循环到 img4),它应该从头开始。悬停时它应该停在 img1。
【问题讨论】:
标签: jquery jquery-plugins
这将循环浏览所有四个图像。当您停止将鼠标悬停以停止图像循环时,我不确定您要完成什么。
/* FOR PEOPLE LIST ITEMS */
$(".box a").hover(
function () {
var self = $(this);
self.data("hover", true);
function flip() {
var top = self.closest(".box");
var next = top.find(".current").next("img");
if (!next.length) {
next = top.find("img:first");
}
top.find("img").hide().removeClass("current");
next.addClass("current").show().flip({
direction:'tb',
speed: 200,
onEnd: function(){
if (self.data("hover")) {
setTimeout(flip,500);
} else {
top.find(".hidden").fadeOut("slow");
top.find(".active").fadeIn("slow");
}
}
})
}
flip();
},
function () {
$(this).data("hover", false);
}
);
【讨论】: