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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:48:59+00:00 2026-05-17T15:48:59+00:00

I have a set up of the following HTML <div class=container> <div class=box>Content</div> <div

  • 0

I have a set up of the following HTML

<div class="container">
    <div class="box">Content</div>
    <div class="box">Content</div>
    <div class="box">Content</div>
    <div class="box">Content</div>
    <div class="box">Content</div>
</div>

I would like to show one .box div at a time within the .container div. Fading in/out or sliding in/out would be preferred. Once the last .box div is shown it should fade to the first again. The number of .box divs could possibly vary. Sometimes there could be 2 and at others there could be 5. Also a slight delay of something like 3-4 seconds would be awesome.

I think this should be pretty straight forward with jQuery but I haven’t yet found the solution I am looking for. Also I cannot use any plug-ins. Thanks in advance for 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-05-17T15:48:59+00:00Added an answer on May 17, 2026 at 3:48 pm

    I think that you’ll want to use the jQuery Cycle plug-in. It has many different transition types (including fading and sliding) and allows a time-delay of your choosing between transitions.

    The demos on the site are all done with images, but you can have any sort of html content you like, and each part will be turned into a “slide.”

    EDIT

    I just saw that you can’t use any plug-ins, but I’ll leave this up here for others who don’t have that restriction.

    EDIT 2

    Barring the use of a plug-in, try something like the following:

    $(function() {
        $('.container .box').css('position', 'absolute').filter(':not(:first)').hide();
        $('.container .box:first').addClass('shown');
    
        setInterval(transition, 4000);
    });
    
    function transition() {
        var current = $('.shown');
        var next = null;
        if (current.next('.box').size() == 0) {
            next = $('.container .box:first');
        } else {
            next = current.next('.box');
        }
        current.fadeOut().removeClass('shown');
        next.fadeIn().addClass('shown');
    }
    

    Here’s a live demo of that: http://jsfiddle.net/FvKAe/

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

Sidebar

Related Questions

I have the following HTML: <div class=menu> <a class=main-nav-item href=home>home</a> <a class=main-nav-item-current href=business>business</a> <a
I have the following HTML code: <fieldset> <legend><span>Contact Details</span> <span class=edit1>Edit</span><span class=hide1>Hide</span></legend> <div> <!--content-->
I have the following node structure in my HTML: <div id=widget1 class=dojoxFloatingPane dijitContentPane dojoxFloatingPaneFg
I have the following HTML: <div class="selfClear" style="float: left; border: 1px solid black;"> ...floated
I have the following html markup: <div id=com_loaded> <div id=com_loaded_userpic><a href=# class=tooltip><img src=pic.jpg class=img_poster
I have the following animation set up using Three.js: http://frontier.lincoln.ac.uk/3d/development/Stage2/characters/man2.html Please ignore the ropey
I have a text file of HTML that includes the following marker set for
I have written the following regex to match a set of e-mails from HTML
I have set up the following: Database class ($db) Pagination class ($paginator) I am
I have the following code- View- <% Html.BeginForm(); %> <div> <%= Html.DropDownList(DropDownSelectList, new SelectList(

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.