Universal Smooth Scroll 4.0.0
·
536 commits
to master
since this release
Version 4.0 is out !
New Features
- the new
scrollIntoViewIfNeededmethod allows you to bring elements into the screen only when needed - added support for
nearestoption in thescrollIntoViewmethod - added a brand new API error/warning system
- the new
getXScrollableParentmethod allows you find the first scrollable parent of a container which is scrollable on the x-axis only - the new
getYScrollableParentmethod allows you find the first scrollable parent of a container which is scrollable on the y-axis only - the default document scrolling element can now be set through the new
uss._pageScrollervariable - ease functions now support callbacks that are executed at each scroll step
- added support for custom bounce-scrolling ease functions
- new bounce-scrolling ease functions are provided in the
universalsmoothscroll-ease-functionlibrary - added support for anchors that use the
nameattribute inside thehrefSetupmethod - added support for anchors that use the
href="#"attribute inside thehrefSetupmethod - added support for the
reduceMotionfeature on Safari older than version 14
Changes compared to the previous version
- the string "nearest" can no longer be used to center items with the
scrollIntoViewmethod because it now indicates thenearestalignment - the default value for the input parameter
containeris nowuss._pageScrollerinstead ofwindow - stepLengthCalculator can now return numbers < 0 without triggering any internal value overlay at runtime
- element made visible with the
scrollintoViewmethod are no longer automatically focused (bugged with new chrome versions) scrollIntoViewmethod now takes the scrollbar dimensions into consideration for the scroll amount- the API now uses
strict mode - the DEMO now uses a less resource-intensive theme
getScrollableParentno longer have a default value for theelementinput parameterscrollIntoViewno longer have a default value for theelementinput parameter- fixed the DEMO's behavior on Firefox and Safari.
IMPORTANT NOTE
universalSmoothScroll 4.0.0 is a Major release and it may not work out-of-the-box with existing universalSmoothScroll 3.x.x based projects.
I suggest you to update the signature of your getScrollableParent and scrollIntoView if you used the default parameters (which were doing basically nothing).
I also suggest you to check the behavior of those particular stepLengthCalculators that used to return a value < 0 relying on the fact that the API was resetting it to the default value at runtime, because it will be different (they will now force the scroll animation to invert its direction).
For any bug or feature request don't hesitate to contact me.
Have a nice day :)
Cristian Davide Conte