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

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

问题描述

为了使用 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 如果元素正在被动画化?

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

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