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

  • Home
  • SEARCH
  • 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 classes: public class Person { public String FirstName { set;
I have the following class public class Car { public Name {get; set;} }
I have a div set to the css class float with float being: .float
I have the following models set up: class Player < ActiveRecord::Base has_many :game_players has_many
I have a data set that is organized in the following manner: Timestamp|A0001|A0002|A0003|A0004|B0001|B0002|B0003|B0004 ...
I have an SQL query that takes the following form: UPDATE foo SET flag=true
If you have the following: $var = 3; // we'll say it's set to
I currently have the following code set up for a jQuery slide. $(document).ready(function ()
I'm writing an MVC2 app using DataAnnotations. I have a following Model: public class
SO I have the following set of code parsing delicious information. It prints data

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.