我正在试图弄清楚这个框架,但我在实现摇晃效果时遇到了问题。每次我将鼠标悬停在元素上时,其他div就会消失。在fiddle中,我尝试了不同的JQuery和JQuery用户界面,它是工作的,但选择最新的只是打破了整个事情。ANy小贴士?谢谢!
https://jsfiddle.net/w11qknc4/
$( ".box" ).mouseenter(function() {
$( this ).effect( "shake", { direction: "up", times: 4, distance: 10}, 1000 );
$( this ).finish().effect( "shake", { direction: "up", times: 4, distance: 2}, 1000 );
});发布于 2017-06-22 05:01:14
这一行不是必需的,它会导致您的问题:
抖动$(
).finish().effect(“”,{方向:“向上”,次数: 4,距离: 2},1000 );
只需使用:
$( ".box" ).mouseover(function() {
$(this).effect( "shake", { direction: "up", times: 4, distance: 2}, 1000 );
});如果希望在一个效果结束之前等待另一个效果,请参见使用:
var start = true,
delay = 1000;
$(".box").mouseover(function() {
if (start) {
start = false;
$(this).effect("shake", { direction: "up", times: 4, distance: 2}, delay);
setTimeout(function () {
start = true;
}, delay)
}
});https://stackoverflow.com/questions/44685936
复制相似问题