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 214681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:23:52+00:00 2026-05-11T18:23:52+00:00

I would like to show divs at a specific interval (10 seconds) and show

  • 0

I would like to show divs at a specific interval (10 seconds) and show next div and as go on and repeat the same.

**

Sequence :

**
On 10th second
show div1 , hide other divs ,
After 5seconds interval
Show div 2 and hide other divs,
After 5 seconds interval
Show div 3 and hide other divs,

and repeat the same for every 10 seconds.


Code Follows:


<div id='div1' style="display:none;"> 
  <!-- content -->
</div>

<div id='div2' style="display:none;"> 
  <!-- content -->
</div>

<div id='div3' style="display:none;"> 
  <!-- content -->
</div>
  • 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-11T18:23:52+00:00Added an answer on May 11, 2026 at 6:23 pm

    Working Example here – add /edit to the URL to play with the code

    You just need to use JavaScript setInterval function

    $('html').addClass('js');
    
    $(function() {
    
      var timer = setInterval(showDiv, 5000);
    
      var counter = 0;
    
      function showDiv() {
        if (counter == 0) {
          counter++;
          return;
        }
    
        $('div', '#container')
          .stop()
          .hide()
          .filter(function() {
            return this.id.match('div' + counter);
          })
          .show('fast');
        counter == 3 ? counter = 0 : counter++;
    
      }
    
    });
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    
    <head>
      <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
      <title>Sandbox</title>
      <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
      <style type="text/css" media="screen">
        body {
          background-color: #fff;
          font: 16px Helvetica, Arial;
          color: #000;
        }
        
        .display {
          width: 300px;
          height: 200px;
          border: 2px solid #000;
        }
        
        .js .display {
          display: none;
        }
      </style>
    </head>
    
    <body>
      <h2>Example of using setInterval to trigger display of Div</h2>
      <p>The first div will display after 10 seconds...</p>
      <div id='container'>
        <div id='div1' class='display' style="background-color: red;">
          div1
        </div>
        <div id='div2' class='display' style="background-color: green;">
          div2
        </div>
        <div id='div3' class='display' style="background-color: blue;">
          div3
        </div>
        <div>
    </body>
    
    </html>

    EDIT:

    In response to your comment about the container div, just modify this

    $('div','#container')
    

    to this

    $('#div1, #div2, #div3')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to show the number of days missing for a specific date.
I would like to show a div based on the Onclick event of an
I would like to show and hide the objects (divs, texts or btns) according
I would like to show and hide the divs that are just under body
I would like to show some hidden text in a Flex application and have
I would like to show some links only to authenticated users in an asp.net
I would like to show a set of consecutive numbers in a UIPickerView component
I would like to show an XML file in my .NET 2.0 WinForms app
I would like to show different tabs in the top navigation of a SharePoint
I would like to Show my Messagebox in the center of its parent form.

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.