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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:43:04+00:00 2026-06-17T18:43:04+00:00

I have a section on my page that is to show 3 divs at

  • 0

I have a section on my page that is to show 3 divs at a time, although there may be additional divs hidden.

By clicking on a “more” button, the next 3 divs will fade in, and the previous ones will fade out.

So if we have 6 divs, the first 3 are displayed, clicking on the More button, divs 4-6 will be displayed.

If possible the 3 divs should be shown at all time.

So for example if we have 5 divs, then when you click on the More button, divs 3-5 are displayed.

I know there is a jquery plugin called jCarousel that can do this, but just wondering if it is possible without a plugin because I am building a responsive website and the carousel plugin uses fixed size DIVs.

EDIT:
HTML:

<a class="more" href="#">More</a>

<div id="container">
    <div class="item"><div>One</div><div>some more text</div></div>
    <div class="item"><div>Two</div><div>some more text</div></div>
    <div class="item"><div>Three</div><div>some more text</div></div>
    <div class="item"><div>Four</div><div>some more text</div></div>
    <div class="item"><div>Five</div><div>some more text</div></div>
    <div class="item"><div>Six</div><div>some more text</div></div>

</div>

Javascript:

$("#container .item").slice(0,3).show();

$(".more").click(function(event) { 
  var $currElements = $("#container .item:visible");
  var $nextElements = $("#container .item:hidden");


    $currElements.hide();
    $nextElements.show();

    event.preventDefault();

});

This is what I currently have: http://jsfiddle.net/Wnp5J/

Just wondering now if it is possible to cycle back to the first 3 items when you click on the button again.

Also, if possible, to always display 3 items.

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

    jsFiddle: Paging & transitions

    jsFiddle: Paging (page always full)

    jsFiddle: Carousel

    Works for any number of elements.

    Paging:

    $("#container .item").slice(0,3).show();
    
    $(".more").click(function() {
    
        var items = $('#container .item:visible').hide().last();
    
        var nextItems = items.nextAll().slice(0, 3);
    
        if (nextItems.length === 0) {
            nextItems = $("#container .item").slice(0, 3);
        }
    
        nextItems.show();
    });
    

    Paging w/Transitions:

    $("#container .item").slice(0,3).show();
    
    $(".more").click(function() {
    
        var items = $('#container .item:visible');
    
        var nextItems = items.last().nextAll().slice(0, 3);
    
        if (nextItems.length === 0) {
            nextItems = $("#container .item").slice(0, 3);
        }
    
        items.stop().hide(500, function() {
            nextItems.show(500);
        });
    });
    

    Paging (page always full):

    $("#container .item").slice(0,3).show();
    
    $(".more").click(function() {
    
        var items = $('#container .item:visible').hide().last();
    
        var nextItems = items.nextAll().slice(0, 3);
    
        if (nextItems.length === 1) {
            nextItems = $("#container .item").slice(-3);
        }
    
        if (nextItems.length === 0) {
            nextItems = $("#container .item").slice(0, 3);
        }
    
        nextItems.show();
    });
    

    Carousel:

    $(function() {
    
        var container = $('#container');
        var cycle = function() {
            container.find('.item')
                .hide()
                .slice(0, 3)
                .appendTo(container)
                .show();
        }
    
        $(".more").click(function() {
            cycle();
        });
    
        cycle();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a section of a website that has three divs next to each
I have a comments section on a webpage that I have hidden initially and
I have a page with multiple divs that hold different sections of content. Initially,
a have a page that consist of: <input type=radio id=oqcline class=section/>OQC Line <input type=radio
I have a portfolio section I am building on a page that displays a
I'm creating a WP theme that will have two sections midway down the page.
I have a section on a page where a user can change their username.
On my page I have a section where I would like to pull in
On a blog detail page, I have a tags section. The html looks like:
I have scripts in my ASPX page, in the header section. I want to

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.