确定JQuery效果是否仍在执行 [英] Determining if JQuery effects are still executing

查看:112
本文介绍了确定JQuery效果是否仍在执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于使用Capybara和Selenium运行Cucumber规范,我需要能够确定某些JQuery效果是否已完成,然后才能继续下一步。是否有一个通用的方法来确定JQuery是否仍然执行效果(例如 $。effects.active.size == 0 )?

解决方案

您可以通过检查:animated selector检查某些动画插件/ p>

http://api.jquery.com/animated- selector /



如下:

  $ #el)。is(:animated)

a href =http://stackoverflow.com/questions/724911/how-do-i-find-out-with-jquery-if-an-element-is-being-animated>我如何发现与jQuery如果某个元素正在动画?


For running Cucumber specs with Capybara and Selenium, I need to be able to determine if certain JQuery effects have completed before I can continue with the next step. Is there a generic way to determine if JQuery is still executing effects (e.g. something like $.effects.active.size == 0)?

解决方案

You can check if element is used by some animation plugin/feature via checking :animated selector

according to this: http://api.jquery.com/animated-selector/

like this:

$("#el").is(":animated")

more info: How do I find out with jQuery if an element is being animated?

这篇关于确定JQuery效果是否仍在执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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