我试图在所有元素都完成'mouseleave'时触发动画。检查是否所有元素都被徘徊过
所以这里是一个片段(我这个重复名为“BOX1,BOX3”以及其他元素)
$("#box4").mouseleave(function() {
$(".contentBox4").hide("slide", {
direction: "right"
}, 100);
$("#box4.gridBox.grid-darker").fadeTo(500, 0);
$(this).unbind("mouseenter").unbind("mouseleave");
});
var boxes = ('#box1, #box3, #box4');
var hasBeenHovered = false;
$(boxes).mouseleave(function() {
hasBeenHovered = true;
if (hasBeenHovered) {
$(".introTitle").fadeIn();
}
});
所以现在,当鼠标离开每一个元素,它执行的动画,而不是当它离开所有这些元素时。
所以如果有人能提供任何见解,非常感谢!
adeneo,非常感谢你。这是有效的,是有道理的。非常感激 – gregdevs