javascript function within a function to repeat itself js jquery jq loop looping


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // animation functions
  2. zlpFX = {
  3. show1: function() {
  4. $('div#mainBackground2').fadeOut(3000);
  5. $('div#transMoving').animate({
  6. paddingLeft: "180px",
  7. paddingTop: "20px"
  8. },
  9. 4000).find('h3').fadeOut(2000);
  10. setTimeout("zlpFX.show2()", 14000);
  11. },
  12. show2: function() {
  13. $('div#mainBackground2').fadeIn(4000);
  14. $('div#transMoving').animate({
  15. paddingLeft: '220px',
  16. paddingTop: '75px'
  17. },
  18. 4500).find('h3').fadeIn(6000);
  19. setTimeout("zlpFX.show1()", 14000);
  20. }
  21. };
  22.  
  23.  
  24.  
  25.  
  26. // now start the animation functions
  27. setTimeout("zlpFX.show1()", 11000);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.