@pushword/js-helper 0.0.102 → 0.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/ScrollEnhancer.js +8 -2
package/package.json
CHANGED
package/src/ScrollEnhancer.js
CHANGED
|
@@ -32,7 +32,10 @@ class ScrollYEnhancer {
|
|
|
32
32
|
element.scrollTop += evt.deltaY
|
|
33
33
|
const after = element.scrollTop
|
|
34
34
|
if (before === after) {
|
|
35
|
-
window.
|
|
35
|
+
window.scrollWithoutDoingNothing++
|
|
36
|
+
if (window.scrollWithoutDoingNothing > 10) window.scrollBy(0, evt.deltaY / 2)
|
|
37
|
+
} else {
|
|
38
|
+
window.scrollWithoutDoingNothing = 0
|
|
36
39
|
}
|
|
37
40
|
//element.classList.toggle('scroll-smooth')
|
|
38
41
|
})
|
|
@@ -137,7 +140,10 @@ class ScrollXEnhancer {
|
|
|
137
140
|
element.scrollLeft += evt.deltaY
|
|
138
141
|
const after = element.scrollLeft
|
|
139
142
|
if (before === after) {
|
|
140
|
-
window.
|
|
143
|
+
window.scrollWithoutDoingNothing++
|
|
144
|
+
if (window.scrollWithoutDoingNothing > 10) window.scrollBy(0, evt.deltaY / 2)
|
|
145
|
+
} else {
|
|
146
|
+
window.scrollWithoutDoingNothing = 0
|
|
141
147
|
}
|
|
142
148
|
//element.classList.toggle('scroll-smooth')
|
|
143
149
|
})
|