确定 JQuery 效果是否仍在执行效果、JQuery

由网友(14.繁华落尽时光易老)分享简介:为了使用 Capybara 和 Selenium 运行 Cucumber 规范,我需要能够确定某些 JQuery 效果是否已完成,然后才能继续下一步.是否有一种通用的方法来确定 JQuery 是否仍在执行效果(例如 $.effects.active.size == 0 之类的东西)?For running Cucum...

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

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)?

推荐答案

您可以通过检查 :animated 选择器来检查元素是否被某些动画插件/功能使用

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

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

像这样:

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

更多信息:我如何找出jQuery 如果元素正在被动画化?

阅读全文

相关推荐

最新文章