jquery hover 不停闪动问题的解决方法(亦为stop()的使用)

2020-05-18 08:58:42易采站长站整理

$("#menu").hover(
function () {
$("#menu").stop(true).animate({ height: "500" }, 5000).animate({ width: "500px" }, 5000);
},
function () {
$("#menu").stop(true).animate({ height: "100" }, 5000).animate({ width: "100px" },5000);
}
);

当然也可以使用第二个参数,让动画达到最后状态。如:stop(false,true)

以上这篇jquery hover 不停闪动问题的解决方法(亦为stop()的使用)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持软件开发网。