Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery - wording rollout animations

0 votes
13 views
added Oct 2 in jQuery by LC Marshal Lieutenant (13,770 points)

jQuery(document).ready(function(){
  var terms = ['joyful','dream','perfect','bargain','ideal','luxury'];
  var i = 0;
  function rollerout(){

    jQuery(".roller").animate({opacity: 0, left: '-150px'}
                        , 500,function(){
                          jQuery(".roller").text(terms[i]);
                          rollin();
                        });
  }
  function rollin(){
    jQuery(".roller").css('display', 'block').animate({opacity: 1.0, left: '150px'}
                        , 500,function(){
                          i = i+1;
                          i = (terms.length == i)?0:i;
                          setTimeout(rollerout,2000);
                        });
  }
  rollin();

})

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...