Skip to content

Universal Smooth Scroll 4.0.0

Choose a tag to compare

@CristianDavideConte CristianDavideConte released this 03 Sep 15:57
· 536 commits to master since this release
e1e32ad

Version 4.0 is out !

New Features

  • the new scrollIntoViewIfNeeded method allows you to bring elements into the screen only when needed
  • added support for nearest option in the scrollIntoView method
  • added a brand new API error/warning system
  • the new getXScrollableParent method allows you find the first scrollable parent of a container which is scrollable on the x-axis only
  • the new getYScrollableParent method 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._pageScroller variable
  • 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-function library
  • added support for anchors that use the name attribute inside the hrefSetup method
  • added support for anchors that use the href="#" attribute inside the hrefSetup method
  • added support for the reduceMotion feature 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 scrollIntoView method because it now indicates the nearest alignment
  • the default value for the input parameter container is now uss._pageScroller instead of window
  • stepLengthCalculator can now return numbers < 0 without triggering any internal value overlay at runtime
  • element made visible with the scrollintoView method are no longer automatically focused (bugged with new chrome versions)
  • scrollIntoView method 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
  • getScrollableParent no longer have a default value for the element input parameter
  • scrollIntoView no longer have a default value for the element input 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