$(".somediv").hover(
function() {
$(this).animate({'margin-top':'100px'},1000);
},
function() {
$(this).animate...…
}
);
$(".somediv").click(function ....????
问题是我如何冻结动画点击在margin-top:100px状态不让onmouseout函数发生后somediv被点击
但是下一次点击应该会解冻悬停功能Thanks on advance
stop()不能阻止
取消悬停$("#one.button").hover(function() {
$(this).animate({'margin-top':'30px'},{queue:false,duration:700});
}, function() {
$(this).animate({'margin-top':'10px'},{queue:false,duration:700});
});
$("#one.button").click(function(){
$("#one.button").stop().animate({'margin-left':'0px'},{queue:false, duration:700});
});
点击# 1后的。按钮动画设置为margin-left:0px,之后不悬停为margin-top:10px
尝试:
$(".somediv").click(function() {
$(this).stop()
});
查看更多信息:
http://api.jquery.com/stop/