0

thank you in advance for you help. I'm working on a site right now that has a built-in jQuery image slider in the header section. I'm fairly new to jQuery but know my way around a bit. I used an online tutorial as a template and it turned out really nice. There is only one problem. For some reason when I switch to a different tab in my browser for a while and then re-open the site the slider starts flipping through the slides really fast until I reload the page. Anybody have any idea what may be causing this? I'm on a Windows 7 Machine in Chrome when it happens.

Site: http://gordonweiss.dunkleedev2.com

  • 1
    Possible duplicate http://stackoverflow.com/questions/6183463/when-using-setinterval-if-i-switch-tabs-in-chrome-and-go-back-the-slider-goes-c – Eric Fortis Jul 20 '11 at 02:23
  • I had this problem, got frustrated, then switched back to jQuery 1.5.2. Fixed. – Zomxilla Jul 20 '11 at 03:35

1 Answers1

0

see John Resig's topic How Javascript timer work

it seems some handler block the queue when page not focus,then the fired interval call go to the end of queue and so on. so when u turn back to the page, the queued js be handled one by one no matter the time used to between each other.and this bug seems to accur in new version jquery1.6, when i use old version jquery it turn out to be fine(see sample )

so, maybe try to use old version jquery, like 1.4 or 1.5

james li
  • 174
  • 1
  • 6
  • Thank you for your response. That is definitely good to know that it works fine with the older version of jQuery. I'm going to try a few solutions from the "Possible Duplicate" response above, but if that doesn't work I'll probably just use an older version of jQuery for now. – tjdunklee Jul 20 '11 at 15:37