Skip to content

Commit

Permalink
Fixing scroll lock while preserving for support for #48
Browse files Browse the repository at this point in the history
  • Loading branch information
NickPiscitelli committed Jul 2, 2019
1 parent 3d4650f commit c7573f0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/assets/js/glider.min.js

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

8 changes: 6 additions & 2 deletions glider.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
\___//_//_/ \_,_/ \__//_/ (_)__/ //___/
|___/
Version: 1.6.7
Version: 1.6.8
Author: Nick Piscitelli (pickykneee)
Website: https://nickpiscitelli.com
Documentation: http://nickpiscitelli.github.io/Glider.js
Expand Down Expand Up @@ -314,7 +314,11 @@
clearTimeout(_.scrollLock)
_.scrollLock = setTimeout(function () {
clearTimeout(_.scrollLock)
if (Math.round(_.ele.scrollLeft / _.itemWidth) % 1) {
// dont attempt to scroll less than a pixel fraction - causes looping
if (Math.abs(_.ele.scrollLeft / _.itemWidth - _.slide) > 0.02) {
if (!_.mouseDown) {
_.scrollItem(_.round(_.ele.scrollLeft / _.itemWidth))
}
_.scrollItem(_.round(_.ele.scrollLeft / _.itemWidth))
}
}, _.opt.scrollLockDelay || 250)
Expand Down
Loading

0 comments on commit c7573f0

Please sign in to comment.