ganeshmax / jcarousellite

jCarousel Lite is a jQuery plugin that carries you on a carousel ride filled with images and HTML content. Put simply, you can navigate images and/or HTML in a carousel-style widget.
MIT License
186 stars 108 forks source link

option.start problem #34

Open wweggplant opened 8 years ago

wweggplant commented 8 years ago

this is in your website

start You can specify from which item the carousel should start. Remember, the first item in the carousel has a start of 0, and so on.

I use your demo/ demo-01.html ,and modifed code: origin:

$(".default .carousel").jCarouselLite({
    btnNext: ".default .next",
    btnPrev: ".default .prev"
});

to:

$(".default .carousel").jCarouselLite({
    start:7,//add this
    btnNext: ".default .next",
    btnPrev: ".default .prev"
});

I found that the sequence of carousel was error when I click the prev/next btn.

then, I read the code,find this: line 199~205

if(to <= options.start - numVisible - 1) {
     newPosition = to + initialItemLength + options.scroll;
     ul.css(animCss, -(newPosition * liSize) + "px");
     calculatedTo = newPosition - options.scroll;
     console.log("Before - Positioned at: " + newPosition + " and Moving to: " + calculatedTo);
}

I think that options.start - numVisible - 1 has problem probably .

please reply me.

thank you ~~ ☺☺☺☺☺☺