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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:50:34+00:00 2026-06-12T17:50:34+00:00

so i have tried making myself an infinite carousel using html, css & jQuery

  • 0

so i have tried making myself an infinite carousel using html, css & jQuery and everything is working apart from the back button will not loop, i’ve spent quite a while doing this now and i’m wondering if anyone has any insight? http://jsfiddle.net/e2SKk/ is where you can see the code! i’m only really doing this because i thought it would give me a chance to learn a lot more, but any criticisms of code layout or technique would be helpful!

specifically its this code thats seems not to work

else if(loopPrev==true){
            sliderActive=true
            $('.item-holder').css({
                'left':clonePos
            });
            $('.item-holder').animate({
                'left':holderPos+$('.slider').width()+'px'
            },function(){
                sliderActive=false;
            });
        };

that is only a snippet btw and won’t make much sense without the rest!

  • 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-12T17:50:36+00:00Added an answer on June 12, 2026 at 5:50 pm

    jQuery is cool to write short scripts.
    Your slider code in short:

    var width = $('.slider').width();
    $('.item').css({width:width});
    var $holder = $('.item-holder').css({left:-width}).prepend($('.item:last'));
    
    $('.prev').click(function(){
        $holder.not(':animated').css({left:-2*width}).prepend($('.item:last')).animate({left:-width});
    });
    $('.next').click(function(){
        $holder.not(':animated').css({left:0}).append($('.item:first')).animate({left:-width});
    });
    

    ​
    That’s the complete code.

    See this in action on http://jsfiddle.net/creativecouple/YPU2d/

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

Sidebar

Related Questions

I'm having trouble making python print out texts properly aligned. I have tried everything
I have tried making every div 75px and the table within the div but
I have tried making a fiddle for this, but it's been too difficult to
I am making a GUI in OpenGL (more specifically lwjgl). I have tried hard
I'm working on a mobile app using Phonegap (1.4.1) / JS (jQuery Mobile 1.0)
I'm making a simple website for myself using wordpress and some hacking to try
I'm making a swing application for myself and have been trying out a few
Have tried to find solutions for this and can't really come up with anything.
I have tried to go through the jungle (really, PayPal, why don't you weed
I have tried searching over the internet about this problem but not able 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.