围绕jquery动画函数包装启动延迟 [英] wrap start delay around jquery animate functions

查看:97
本文介绍了围绕jquery动画函数包装启动延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$(".left").animate({left:"-50%"},4000);
$(".center").animate({right:"-50%"},8000);
$(".right").animate({right:"-50%"},4000);

我想简单地延迟以上所有动画的开始,方法是在它们周围包装一个延迟函数,保持相同的动画代码,只是在大约1100);

I would like to simply delay start all of my animations above, by wrapping a delay function around them, keeping the same animate code, just start after about 1100);

推荐答案

您需要的是调用 delay( )

例如,尝试$(".left").delay(2000).animate({left: "-50%"}, 4000);插入2秒的延迟.

Try $(".left").delay(2000).animate({left: "-50%"}, 4000); to insert a delay of 2 seconds, for example.

这篇关于围绕jquery动画函数包装启动延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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