这是jsfiddle。
如您所见,在大红球从右侧淡入之后,我正试图在同一窗口中打开 google.com。相反,google.com 在从右侧淡入开始后大约一秒钟打开。如何让我的 window.location 函数等到淡入完全完成?
是的,我有 JQuery 1.6.2 链接到我的页面。
标记:
<a href="http://www.google.com"><img class="animated fadeInRightBig" src="http://www.clipartsfree.net/vector/large/roystonlodge_Simple_Glossy_Circle_Button_Red_Vector_Clipart.png" style="">
</a>
</body>
查询:
$('.animated').promise().done(function(){
window.location = "http://www.google.com";
});
文森特:我尝试了以下方法,但没有成功。有任何想法吗?
$('.animated fadeInRightBig').on('transitionend webkitTransitionEnd oTransitionEnd otransitionend', function() {
window.location = 'http://www.google.com';
});