问题描述
对于使用Capybara和Selenium运行Cucumber规范,我需要能够确定某些JQuery效果是否已完成,然后才能继续下一步。是否有一个通用的方法来确定JQuery是否仍然执行效果(例如 $。effects.active.size == 0
)?
您可以通过检查:animated
selector检查某些动画插件/ p>
:
如下:
$ #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效果是否仍在执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!