從這個網站inpired: http://www.designchemical.com/lab/jquery/demo/jquery_demo_slick_jquery_sliding_captions.htm如何在hoverOut之後停止動畫?
我曾嘗試使用下面的代碼創建了自己的版本:
$(document).ready(function(){
$(".transparencyOverlay").css("display", "none");
$(".thumbnailTextContainer").css("display", "none");
$(".contestantFirst, .contestant").hover(function(){
$(this).children(".transparencyOverlay, .thumbnailTextContainer").slideToggle('slow');
},function(){
$(this).children(".transparencyOverlay, .thumbnailTextContainer").slideToggle('slow');
});
});
的問題是,當我在圖像中徘徊進出連續,動畫將即使當光標在圖像之外時仍繼續運行,任何人都知道如何解決這個問題?
使用'$(本)。兒童( 「transparencyOverlay,.thumbnailTextContainer」)停止(真).slideToggle( '慢');'停止動畫然後開始滑動... – Atrox111