Skip to content

Commit

Permalink
Merge pull request #303 from onvardgmbh/infinite-slide-fix
Browse files Browse the repository at this point in the history
fix: detect last slide by index instead of by offset
  • Loading branch information
meandmax authored Aug 26, 2016
2 parents dbbf366 + a0b0853 commit 5b85f37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lory.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export function lory (slider, opts) {
index = nextIndex;
}

if (infinite && (Math.abs(nextOffset) === maxOffset || Math.abs(nextOffset) === 0)) {
if (infinite && (nextIndex === slides.length - infinite || nextIndex === 0)) {
if (direction) {
index = infinite;
}
Expand Down

0 comments on commit 5b85f37

Please sign in to comment.