jQuery-等待动画完成以触发下一个功能 [英] Jquery - Wait until animation is complete to trigger next function

查看:64
本文介绍了jQuery-等待动画完成以触发下一个功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好编码员
我使用jquery的第一周,到目前为止进展顺利,但遇到了我的第一个小障碍.
我希望div动画在触发下一个功能之前完成.
从我所读的内容中,我需要在动画后添加一个函数,但是当我尝试修改代码时,最终会出错.我希望有人可以为我解决这个问题.谢谢:)

Hello coders
My first week of using jquery, going well so far but met my first small hurdle.
I would like the div animation to finish before triggering the next function.
From what I have read I need to add a function after animate but when I try and adapt the code I end up with errors. I hope someone can solve this one for me. Thanks :)

<script>
$(document).ready(function() {
$('#slick2').click(function() {
$("#flash").animate({'width':'500px','height':'800px'},800);(pause/wait)
document.getElementById('main').height="800";
});
});
</script>

推荐答案

(文档).ready(函数(){
(document).ready(function() {


(' #slick2').click(函数(){
('#slick2').click(function() {


( #flash").animate({宽度': 500px' height': 800px'}, 800 );(暂停/等待) 文档 .getElementById(' main') .height = " ; }); }); </script>
("#flash").animate({'width':'500px','height':'800px'},800);(pause/wait) document.getElementById('main').height="800"; }); }); </script>


这篇关于jQuery-等待动画完成以触发下一个功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆