Skip to content

Commit

Permalink
Merge pull request #3037 from Munawwar/patch-2
Browse files Browse the repository at this point in the history
Not to scroll when infinite scrolling isn't on
  • Loading branch information
Greg Westneat committed Sep 12, 2017
2 parents 91d5038 + b3eaa61 commit 86ed071
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions slick/slick.js
Original file line number Diff line number Diff line change
Expand Up @@ -2493,7 +2493,7 @@
if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) {
if (_.options.fade === false) {
targetSlide = _.currentSlide;
if (dontAnimate !== true) {
if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) {
_.animateSlide(slideLeft, function() {
_.postSlide(targetSlide);
});
Expand All @@ -2505,7 +2505,7 @@
} else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) {
if (_.options.fade === false) {
targetSlide = _.currentSlide;
if (dontAnimate !== true) {
if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) {
_.animateSlide(slideLeft, function() {
_.postSlide(targetSlide);
});
Expand Down Expand Up @@ -2575,7 +2575,7 @@
return;
}

if (dontAnimate !== true) {
if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) {
_.animateSlide(targetLeft, function() {
_.postSlide(animSlide);
});
Expand Down

0 comments on commit 86ed071

Please sign in to comment.