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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:06:31+00:00 2026-06-12T18:06:31+00:00

I got 3 sections and would like to show them one by one by

  • 0

I got 3 sections and would like to show them one by one by using jQuery and I don’t know how?

JQUERY

$infos = $(“#ex-2”).find(‘section’).hide(),

HTML

<div class="ex">
  <article>
    <section>
      <font style="background-color:#000000"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
        Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
        Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </font>
    </section>
    <section>
      <font style="background-color:#000000"> testing testing </font>
    </section>
    <section>
      <font style="background-color:#000000">testing 2</font>
    </section>
  </article>
</div> 

Any help?

  • 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-06-12T18:06:32+00:00Added an answer on June 12, 2026 at 6:06 pm

    Well first up your container div has a class, not an id, so you need to select with ".ex" not "#ex-2". Then try something like this:

    $(document).ready(function() {
        var $infos = $(".ex").find('section').hide(),
            i = 0;
    
        function showOneByOne(){
            if (i < $infos.length)
                $infos.eq(i).fadeIn(500, showOneByOne);
            i++;
        }
        showOneByOne();
    });
    

    Demo: http://jsfiddle.net/A2Nbu/

    If “show them one by one” means show one, then hide it and show the next, and keep going indefinitely, then a minor modification to the above will do that:

    $(document).ready(function() {
        var $infos = $(".ex").find('section').hide(),
            i = 0;
    
        function showOneByOne(){
            $infos.eq(i).fadeIn(500).fadeOut(100, showOneByOne);
            i = (i + 1) % $infos.length;      
        }
        showOneByOne();
    });
    

    Demo: http://jsfiddle.net/A2Nbu/2/

    Either way the idea is to start with the sections hidden, and cycle through them one by one using an index variable i.

    Details about the jQuery methods I’ve used are available at the jQuery API reference site.

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

Sidebar

Related Questions

I would like create a tabbed mobile page using jQuery Mobile. I have got
I've got a string like this: #################### Section One #################### Data A Data B
I would like to share one of my practical experience with multiprogramming here. Yesterday
I know this is a very simple and basic question but I would like
I got a news display section in my web application. I need to show
my desired app.config would be like this: <configSections> <sectionGroup name=QA_Environment> <section name=databases type=System.Configuration.NameValueSectionHandler/> <section
I just got the code for the new like button (the one that also
I've got a class that I would like to inherit. i.e. ExpenseForm should inherit
I'd like to be able to loop certain sections of a sample using c4.
I've got several pictures that I would like to arrange and then center in

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.