Treehouse: Grow your CSS skills. Land your dream job.

problem with jquery image slider

  • # March 29, 2012 at 9:42 am

    Hi warriors
    I m new to jquery had just tried to make a horizontal image slider. Problem is clicking on ‘next’ btn should not work when on last slide, same with ‘prev’ button.

    can any one help me out.

    # March 29, 2012 at 3:17 pm

    You need to add a step to both your previous and next functions – for example:

    $(“#next”).click( function(){
    $(current).animate({left: “-=1500px”, top: “0px”}),


    step: function(right) {
    if (left < = 1500px) { //Slide width x number of slides

    $(current).stop(true, true);



Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.