Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7030743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:42:44+00:00 2026-05-28T00:42:44+00:00

making an infinite loop in javascript, and jQuery… this is my current code: $(#bg2).css({opacity:

  • 0

making an infinite loop in javascript, and jQuery…

this is my current code:

$("#bg2").css({"opacity": "0"});

$("#bg3").css({"opacity": "0"});

//

var z = 1;

while(z<1000){


    $("#bg1").animate({"opacity": "1"}, {"duration": (1000)}).delay(6000).animate({"opacity": "0"}, {"duration": (1000)}); 

    $("#bg2").delay(6000).animate({"opacity": "1"}, {"duration": (1000)}).delay(6000).animate({"opacity": "0"}, {"duration": (1000)});

    $("#bg3").delay(12000).animate({"opacity": "1"}, {"duration": (1000)}).delay(6000).animate({"opacity": "0"}, {"duration": (1000)}); 


    z++;

};

Now I don’t know why but the timing stuffs up from the 2nd loop…


Essentially this is what I want to do:

  1. bg1 is already faded in, it must stay for 6 seconds before fading out over 1 second

  2. while bg 1 is fading out, bg 2 must fade in and then stay for 6 seconds, then fade out over 1 second

  3. while bg 2 is fading out, bg 3 must fade in and stay for 6 seconds before fading out

  4. as bg 3 fades out, bg 1 fades back in

then the loop must continue forever…

how should I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:42:44+00:00Added an answer on May 28, 2026 at 12:42 am

    Maybe using a jQuery Queue would help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is the code snippet, this goes into an infinite loop - with the
Everytime I make code involving a while loop, the GUI freezes up, creating an
I need a hand making this code below working. I've had it working so
Suppose I have this code: static void Main(string[] args) { var thread = new
some Function() { for(xxxxxx){ //a infinite loop or just a long code loading an
Making my first steps in RIA Services (VS2010Beta2) and i encountered this problem: created
I'm making a game. The game consists of an infinite plane. Units must be
So I am making this Guess the number game in c++ that looks like
I've got an issue making scanner working for this particular string. here comes the
I'm making some stuff using jQuery. Sometimes I have, for example, a bunch of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.