Universal Smooth Scroll 5.0.0
·
364 commits
to master
since this release
Version 5.0 is out !
New Features
- the new
getFinalXPositionfunction allows you to retrieve the final position of a scroll-animation on the x-axis of a container - the new
getFinalYPositionfunction allows you to retrieve the final position of a scroll-animation on the y-axis of a container - the new
calcBordersDimensionsallows you to retrieve the borders' sizes of a container - the new
getAllScrollableParentsallows you to retrieve all the scrollable parents of a container - the new
updateHistoryparameter ofhrefSetupallows you to update the browser's history whenever an anchor is clicked and to support automatic smooth-scrolling between fragments when the user navigates through the history - the new
isTemporaryparameter ofsetXStepLengthCalculator,setYStepLengthCalculatorandsetStepLengthCalculatorallows you to set a one-timeStepLengthCalculatorthat will control only the next scroll-animation StepLengthCalculatorscan now be dynamically changed even when there's a scroll-animation happening- it is now possible to initiate a scroll-animation from inside a
StepLengthCalculator - it is now possible to stop a scroll-animation from inside a
StepLengthCalculator - the new
_debugModeand its accessors allow you to disable debug messages or to just display them unstyled scrollIntoViewandscrollIntoViewIfNeedednow takes containers' borders into considerationscrollIntoViewIfNeedednow takes scrollbars into considerationscrollIntoViewIfNeeded's callback invocation time has been greatly reducedgetXScrollableParent,getYScrollableParent,getScrollableParent,scrollIntoViewandscrollIntoViewIfNeedednow all work with containers that has the css propertyposition:fixedcalcScrollbarsDimensionsnow supports containers that hide the scrollbars through the css properties::webkit-scrollbarorscrollbar-widthscrollIntoViewandscrollIntoViewIfNeededare 20% faster than before- the
stillStartparameter now works properly in thescrollByfunction scrollIntoViewandscrollIntoViewIfNeedednow work with any amount of nested containersgetMaxScrollXandgetMaxScrollYnow work properly with thehtml, thebodyand thewindowelementscalcScrollbarDimensionsnow works properly with thehtmland thebodyelements- the default constant values of the API now scales with the browser's window resolution
- the documentation is now divided into navigable sections and it's more informative
- bugfixes and performance improvements
Changes compared to the previous version
scrollIntoViewIfNeedednow only centers the element to its closest scrollable parent instead of centering every scrollable ancestorhrefSetupnow scrolls theuss._pageScrollerto (0, 0) when the anchor's destination (href) is#getXScrollableParent,getYScrollableParentandgetScrollableParentnow returnnullif an element doesn't have a scrollable parent- a warning is now emitted whenever a
StepLengthCalculatordoesn't return a valid stepLength during a scroll-animation
IMPORTANT NOTE
Universal Smooth Scroll 5.0.0 is a major release of the API and it may not work out-of-the-box with existing Universal Smooth Scroll 4.x.x projects.
I suggest you to check the return value of getXScrollableParent, getYScrollableParent and getScrollableParent functions that you invoked on containers that may not have a scrollable parent, because the return value is now null instead of window.
I also suggest you to check if the new scrollIntoView and scrollIntoViewIfNeeded behave as you expect on containers that have scrollabars/borders.
For any bug or feature request don't hesitate to contact me.
Happy holidays 🎅🎆