Skip to content

Commit

Permalink
Rounding scroll positions when doing visible checks
Browse files Browse the repository at this point in the history
This fixes issue NickPiscitelli#40
  • Loading branch information
NickPiscitelli committed Apr 14, 2019
1 parent 4c29e69 commit b4b6d08
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/assets/js/glider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion glider.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@
)
}

var isVisible = itemStart >= start && itemEnd <= end
var isVisible =
Math.ceil(itemStart) >= start && Math.ceil(itemEnd) <= end
slideClasses.toggle('visible', isVisible)
if (isVisible !== wasVisible) {
_.emit('slide-' + (isVisible ? 'visible' : 'hidden'), {
Expand Down
Loading

0 comments on commit b4b6d08

Please sign in to comment.