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.

    http://jsfiddle.net/matthew_b/6zrnW/1/

    # 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(){
    alert(‘hi’);
    $(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.

*May or may not contain any actual "CSS" or "Tricks".