我有this代码
HTML:
<div class="random">div 1</div>
<div class="random animation">div 2</div>
<div class="random animation">div 3</div>
<div class="random animated">Fade</div>
JS:
jQuery( document ).ready( function( $ ) {
$( ".animation" ).hover(
function() {
$( ".animated" ).hide( 500 );
}, function() {
$( ".animated" ).show( 500 );
}
);
});
如何在div 2和div 3之间切换时不触发动画? 我想这很简单...
<小时/>stop()
有一个问题,实际上我正在使用
addClass( "uk-animation-reverse uk-animation-scale-down" )
和
removeClass( "uk-animation-reverse" )
控制动画=/是这样工作还是有其他想法?
最佳答案
简单stop
动画(如果它在每个元素的悬停事件之间运行):
jQuery( document ).ready( function( $ ) {
$(".animation" ).hover(
function() {
$( ".animated" ).stop().hide( 500 );
}, function() {
$( ".animated" ).stop().show( 500 );
}
);
});
关于javascript - jQuery 悬停动画仅在不同类之间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29808887/