setInterval not working properly on Chrome

前端 未结 4 714
轻奢々
轻奢々 2020-11-30 07:11

I have a custom made slideshow object to perform the usual stuff the name indicates on a website. It all works well except when I switch tabs in Chrome and come back to the

4条回答
  •  日久生厌
    2020-11-30 07:41

    Most likely, you shouldn't expect setInterval to ever be accurate. If I were you, I would check that the interval is correct by comparing the previous interval time to the current one. That should make the code more robust.

提交回复
热议问题