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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:51:49+00:00 2026-06-09T02:51:49+00:00

I am trying to display elements one after another… For example if there are

  • 0

I am trying to display elements one after another… For example if there are 10 elements in a div, I want to display one after one. But only one Item at a time. I have written the below code but it is not working as expected..

 function fades(c) {
            var x = c;
            c.fadeIn(3000, function () {
                if (c.is('last-child')) {
                    c.fadeOut(3000);
                    fades(c);
                }
                else {
                    c.fadeOut(3000);
                    fades(c.next());
                }
            });
  }

Thanks

  • 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-09T02:51:50+00:00Added an answer on June 9, 2026 at 2:51 am

    HTML

    <div id="fades">
        <div>Hello #1</div>
        <div>Hello #2</div>
        <div>Hello #3</div>
        <div>Hello #4</div>
        <div>Hello #5</div>
        <div>Hello #6</div>
        <div>Hello #7</div>
        <div>Hello #8</div>
        <div>Hello #9</div>
        <div>Hello #10</div>
    </div>
    

    JavaScript

    // First hide them all
    $("#fades div").hide();
    
    function fades($div, cb) {
        $div.fadeIn(100, function () {
            $div.fadeOut(100, function () {
                var $next = $div.next();
                if ($next.length > 0) {
                    fades($next, cb);
                }
                else {
                    // The last element has faded away, call the callback
                    cb();
                }
            });
        });
    }
    
    function startFading($firstDiv) {
        fades($firstDiv, function () {
            startFading($firstDiv);
        });
    }
    
    startFading($("#fades div:first-child"));
    

    Here’s a fiddle: http://jsfiddle.net/VesQ/chw3f/5/

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

Sidebar

Related Questions

I'm trying to display two <div> elements on the same line, but in the
trying to display data only after variables have been set. $(document).ready(function () { function
I'm trying to display one of two headings depending on whether some DOM elements
I am trying to replace div elements with button elements to improve accessibility, but
Trying to display current time with PHP (using this ): $date = date('m/d/Y h:i:s
I'm trying to write an if statement where if one of the elements has
This is probably an easy one but I want to hide variably named UI
I am currently trying to unhide a DIV and then right after scroll down
I'm trying to display dynamically changeable data manipulating with DOM elements (adding/removing them). I
I'm trying to show and hide elements, sort of like a slideshow, but I

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.