Permalink
Browse files

fix single pixel rounding error on nextPage and nextSlide:

sometimes, lemmonSlider cannot loop on nextPage and nextSlide because of a 1 px rounding error on nextPage and nextSlide;
  • Loading branch information...
joshuaballoch committed May 14, 2013
1 parent ccc0e55 commit ccef3c9d0cbffc385598fccc16a9a7a38e6eaac2
Showing with 2 additions and 2 deletions.
  1. +2 −2 lemmon-slider.js
View
@@ -76,7 +76,7 @@
}
});
- if ( x > 0 && $sliderContainer.outerWidth() - scroll - $slider.width() > 0 ){
+ if ( x > 0 && $sliderContainer.outerWidth() - scroll - $slider.width() - 1 > 0 ){
slideTo( e, $slider, scroll+x, slide, 'fast' );
} else if ( options.loop ){
// return to first
@@ -126,7 +126,7 @@
}
});
- if ( x > 0 && scroll + w < originalWidth ){
+ if ( x > 0 && scroll + w + 1 < originalWidth ){
slideTo( e, $slider, scroll+x, slide, 'slow' );
} else if ( options.loop ){
// return to first

0 comments on commit ccef3c9

Please sign in to comment.