Skip to content

4.0.0

Compare
Choose a tag to compare
@quentinhocde quentinhocde released this 16 Nov 16:46
· 71 commits to master since this release

Changelog

New features

  • Add horizontal scrolling (usage example: horizontal.html).
  • Update export to only import the native Class.
  • Update scrollTo parameters with the options object (offset, duration, easing...).
  • Add context system to set specific options for desktop , tablet and mobile separately.
  • Rewrite the instance options. Learn more
  • Add data-scroll-id="" attribute to select elements.
  • Add currents "in view" elements as object in the on scroll event.
  • Add a progress value from 0 to 1, while the element is in the viewport. Useful to play an animation for example. Learn more

Export updates
It's now possible to only import the Native Class, if you don't want the smooth scrolling.

As usual, you can do like this:

import LocomotiveScroll from 'locomotive-scroll';

Or just import the Native Class:

import { Native } from 'locomotive-scroll';

And create your instance like before

// const scroll = new LocomotiveScroll(options);
const scroll = new Native(options);