Configurable smooth scroll with optional motion blur. Uses requestAnimationFrame (like V-Sync).
A continuación se muestran las versiones de este script en las que se actualizó el código. Ver todas las versiones.
Alright folks, big jump from v2.4! This wasn't just dusting off the cobwebs; it's more like a full engine swap and a new paint job. Here's the scoop on what changed:
✨ New Stuff & Major Goodies:
cfg.mBlur
cfg.mBlurInt
scrollAcceleration
cfg.accDelFct
cfg.accMaxMult
targetRefreshRate
requestAnimationFrameUpdate
requestAnimationFrame
_animStep
🚀 Improvements & Refactors (Under the Hood):
1 - cfg.smth
_getTgt
div
composedPath
overflow
isScrollable
canScroll
hasScrollbar
stMap
subPixelOffset
pixelScrollAmount
WeakMap
tgtY
curY
ts
mult
SmoothScroll
_
capture: true
passive: false
wheel
preventDefault()
touchstart
⚙️ Config Changes (Out with the Old, In with the New):
scrollSmoothness
debugMode
maxRefreshRate
minRefreshRate
animationDuration
passiveEventListeners
smth
stpMult
accDelFct
accMaxMult
thrsh
scrollThreshold
lnHt
deltaMode === 1
mBlur
mBlurInt
dbg
🗑️ Removed:
start
stop
String.prototype.encamel
TL;DR:
Version 3.3 is a significant rewrite focusing on smoother animation via requestAnimationFrame, a better acceleration feel, optional motion blur, more reliable target finding, and cleaner, modern code. Configuration is different, so check the new cfg object! Should feel better overall. Enjoy the scroll! 🚀
cfg
Version 2.4
SmoothScroll.settings
String.encamel
@grant none
Fixed Calculation Issues:
ScrollPixels
ScrollSubpixels
Improved Scroll Handling:
Handled Edge Cases:
CanScroll
HasScrollbar
Performance Improvements:
RequestAnimationUpdate
Error Handling:
General Code Cleanup:
Compatibility:
Performance on Low-End Devices: