By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,314 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

How to loop jQuery?

P: 1
How can I loop this function to play forever?

Expand|Select|Wrap|Line Numbers
  1. $(document).ready(function animateText() {
  2.         $('.first').animate({right: '1500px'}, 3000); //Do you know?
  3.         $('.first').animate({left: '1000px'}, 500); //Do you know?
  4.         $('.shadow1').delay(3800).show(1000); //under What this is
  5.         $('.second .a').delay(3800).show(500); //What
  6.         $('.second .b').delay(4000).show(500); //This 
  7.         $('.second .c').delay(4200).show(500); //Is?
  8.         $('.third').delay(6200).animate({left: '125px'}, 500); //DO YOU KNOW? bottom of screen
  9.         $('.shadow1').delay(1800).hide(500);
  10.         $('.second .a').delay(3500).animate({bottom: '30px'}, 300); //What
  11.         $('.second .b').delay(3800).animate({bottom: '30px'}, 300); //This 
  12.         $('.second .c').delay(4100).animate({bottom: '30px'}, 300); //Is?
  13.         $('.second').delay(10000).hide(500); //What this is
  14.         $('.third').delay(3500).animate({top: '125px'}, 500); //DO YOU KNOW? bottom of screen
  15.         $('.fourth').delay(10500).show(500); //No?
  16.         $('.fifth .a').delay(12000).animate({left: '85px'}, 300); //Are
  17.         $('.fifth .b').delay(12300).animate({left: '95px'}, 300); //You
  18.         $('.fifth .c').delay(12600).animate({left: '180px'}, 300); //Kidding
  19.         $('.fifth .d').delay(12900).animate({left: '100px'}, 300); //Me?
  20.         $('.fourth').delay(4000).animate({'font-size': '150px', 'bottom': '50px', 'right': '50px'}, 300); //No?
  21.         $('.fifth').delay(15000).hide(500); //are you kidding me?
  22.         $('.fourth').delay(2000).hide(500); //No?
  23.         $('.sixth').delay(18000).show(1000); //This is a kinetic animation
  24.     });
Jun 29 '11 #1
Share this Question
Share on Google+
1 Reply


P: 2
Expand|Select|Wrap|Line Numbers
  1.     $(document).ready(
  2. function animateText() {while(true){
  3.             $('.first').animate({right: '1500px'}, 3000); //Do you know?
  4.             $('.first').animate({left: '1000px'}, 500); //Do you know?
  5.             $('.shadow1').delay(3800).show(1000); //under What this is
  6.             $('.second .a').delay(3800).show(500); //What
  7.             $('.second .b').delay(4000).show(500); //This 
  8.             $('.second .c').delay(4200).show(500); //Is?
  9.             $('.third').delay(6200).animate({left: '125px'}, 500); //DO YOU KNOW? bottom of screen
  10.             $('.shadow1').delay(1800).hide(500);
  11.             $('.second .a').delay(3500).animate({bottom: '30px'}, 300); //What
  12.             $('.second .b').delay(3800).animate({bottom: '30px'}, 300); //This 
  13.             $('.second .c').delay(4100).animate({bottom: '30px'}, 300); //Is?
  14.             $('.second').delay(10000).hide(500); //What this is
  15.             $('.third').delay(3500).animate({top: '125px'}, 500); //DO YOU KNOW? bottom of screen
  16.             $('.fourth').delay(10500).show(500); //No?
  17.             $('.fifth .a').delay(12000).animate({left: '85px'}, 300); //Are
  18.             $('.fifth .b').delay(12300).animate({left: '95px'}, 300); //You
  19.             $('.fifth .c').delay(12600).animate({left: '180px'}, 300); //Kidding
  20.             $('.fifth .d').delay(12900).animate({left: '100px'}, 300); //Me?
  21.             $('.fourth').delay(4000).animate({'font-size': '150px', 'bottom': '50px', 'right': '50px'}, 300); //No?
  22.             $('.fifth').delay(15000).hide(500); //are you kidding me?
  23.             $('.fourth').delay(2000).hide(500); //No?
  24.             $('.sixth').delay(18000).show(1000); //This is a kinetic animation
  25.         }
  26. });
  27.  
  28.  
  29.  
Jun 30 '11 #2

Post your reply

Sign in to post your reply or Sign up for a free account.