jQuery/[removed] My recursive setTimeout function speeds up when tab becomes inactive

后端 未结 2 1183
鱼传尺愫
鱼传尺愫 2020-12-04 02:22

I\'ve got an odd little dilemma in this jQuery slideshow plugin that I am building.

It\'s nothing fancy and the code I have written to date is working great however

2条回答
  •  猫巷女王i
    2020-12-04 02:47

    Some browsers (like Chrome) drastically slow down recurring timers when the tab goes inactive and then, when the tab comes active again, they try to "catch up" so that the same number of actual timer events has occurred. All I can think of as a work-around is for you to stop the slideshow entirely when the tab goes inactive and start it again when it comes active.

提交回复
热议问题