Jump to content
GreenSock

Vitor Amorim

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Vitor Amorim

  1. Hi guys,
     
    i have slideshow tween on a page that i'm doing, but everytime that i switch tabs in my browser and stay for a while in this other tab, when i get back to the page, the slideshow accumulates javascript queue and it starts frenetic running the script that did not runned when i was in the other tab, how can i solve this problem?

    here is some of my code.

    Sorry for the english.
     
    Thank you

    Diverso.prototype.highlight = function () {
      var actual = parseInt($('.showSlide').attr('id').replace('slide-',''));
      if(actual == $('.slide').length - 1){
        var next = 1;
      }else{
        var next = actual + 1;
      }
      $('.showSlide').removeClass('showSlide');
      $('#slide-'+ next).addClass('showSlide');
    
      diverso.tl.to($('.boxSlides'), 0.8, {left: '-='+$('.slide').width(),
        onComplete:function(){
          $('.thumbShow').removeClass('thumbShow');
          $('#thumb-'+ next).addClass('thumbShow');
          if(next == 1){
            diverso.tl.to($('.boxSlides'), 0.001, {left: 0, onComplete:function(){
              diverso.highlight();
            }});
          }else{
            diverso.highlight();
          }
    
        }
      }, "+=5.0");
    };
    
×