Detecting if Anything on the Page is being Animated

前端 未结 2 1052
借酒劲吻你
借酒劲吻你 2021-01-03 10:26

I know about the :animated selector, but currently am running into (what might be one of a few) performance issue for older IE\'s (go figure). I feel like it mi

2条回答
  •  抹茶落季
    2021-01-03 11:23

    All jQuery animation timers are stored in the array $.timers. One option is just to check whether length of $.timers property is more than zero:

    if ($.timers.length > 0) {
        // something is animating
    }
    

提交回复
热议问题