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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:32:06+00:00 2026-05-14T05:32:06+00:00

Successfully used jquery-infinite-carousel in the past but for my current project I need it

  • 0

Successfully used jquery-infinite-carousel in the past but for my current project I need it to loop forever AND also jump 3 items at a time.
Example of how it works jumping 1 at a time here.

jQuery.fn.carousel = function(previous, next, options){
var sliderList = jQuery(this).children()[0];

if (sliderList) {
    var increment = jQuery(sliderList).children().outerWidth("true"),

    elmnts = jQuery(sliderList).children(),
    numElmts = elmnts.length,
    sizeFirstElmnt = increment,
    shownInViewport = Math.round(jQuery(this).width() / sizeFirstElmnt),
    firstElementOnViewPort = 1,
    isAnimating = false;

    //console.log("increment = " + increment);
    //console.log("numElmts = " + numElmts);
    //console.log("shownInViewport = " + shownInViewport);

    for (i = 0; i < shownInViewport; i++) {
        jQuery(sliderList).css('width',(numElmts+shownInViewport)*increment + increment + "px");
        jQuery(sliderList).append(jQuery(elmnts[i]).clone());
    }

    jQuery(previous).click(function(event){
        if (!isAnimating) {
            if (firstElementOnViewPort == 1) {
                jQuery(sliderList).css('left', "-" + numElmts * sizeFirstElmnt + "px");
                firstElementOnViewPort = numElmts;
                console.log("firstElementOnViewPort = " + firstElementOnViewPort);
            }
            else {
                firstElementOnViewPort--;
            }

            jQuery(sliderList).animate({
                left: "+=" + increment,
                y: 0,
                queue: true
            }, "swing", function(){isAnimating = false;});
            isAnimating = true;
        }

    });

    jQuery(next).click(function(event){
        if (!isAnimating) {
            if (firstElementOnViewPort > numElmts) {
                firstElementOnViewPort = 2;
                jQuery(sliderList).css('left', "0px");
            }
            else {
                firstElementOnViewPort++;
            }
            jQuery(sliderList).animate({
                left: "-=" + (increment),
                y: 0,
                queue: true
            }, "swing", function(){isAnimating = false;});
            isAnimating = true;
        }
    });
}

};

  • 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-14T05:32:06+00:00Added an answer on May 14, 2026 at 5:32 am

    That will take a lot of re-coding to make that plugin work the way you desire. Have you looked at jCarousel? Particularly this example?


    Actually, thinking about it more… you could try triggering a click. Here is how I modified the demo:

    HTML/CSS

    <style type="text/css">
     #simplePrevious, #simpleNext { display: none; }
    </style>
    
    <div class="demo">
     <h2 class="hl">Basic example</h2>
     <div id="viewport">
      <ul>
       <li>1</li>
       <li>2</li>
       <li>3</li>
       <li>4</li>
       <li>5</li>
      </ul>
     </div>
     <a id="multi-prev">&lt;&lt;</a><a id="simplePrevious">Previous</a>
     <a id="simpleNext">Next</a><a id="multi-next">&gt;&gt;</a>
    </div>
    

    Script

    jQuery(document).ready(function(){
     jQuery('#viewport').carousel('#simplePrevious', '#simpleNext');
    
     var simulateClicks = 3;
    
     $('#multi-next').click(function(){
      var i=0, t = setInterval( function(){
       $('#simpleNext').trigger('click');
       i++;
       if ( i > simulateClicks - 1 ) { clearInterval(t); }
      }, 500 );
     });
    
     $('#multi-prev').click(function(){
      var i=0, t = setInterval( function(){
       $('#simplePrevious').trigger('click');
       i++;
       if ( i > simulateClicks - 1 ) { clearInterval(t); }
      }, 500 );
     });
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've used JQuery in the past to fade divs in and out successfully. However,
I need to used dynamic order query in mysql and i have successfully achieved
I'm a complete noob to jquery and jquery ui but have successfully implemented a
has anyone successfully used the jQuery ui.layout plugin to load jQuery mobile inside the
I have recently used the Asual Jquery Address v.1.3 and it workes successfully with
I've successfully used the Windows SendMessage method to help me do various things in
I have successfully used the Excel and Word addin templates in Visual studio 2008
Has anyone successfully used Tokyo Cabinet / Tokyo Tyrant with large datasets? I am
I wrote a device controller (rs232) and it is being used successfully, however users
What various methods and technologies have you used to successfully address scalability and performance

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.