/parallax-scroll

Just a tiny library for parallax without JQuery

Primary LanguageJavaScript

Parallax-scroll ES6

Animation parallax on Scrool vertical using requestAnimationFrame and CSS3 3D transitions.

Properties

  • X: X axis translation (in pixels)
  • Y: Y axis translation (in pixels)
  • Z: Z axis translation (pixels)

Parameters

  • from-scroll: vertical scroll position the animation starts (default: when the element is visible)
  • distance: distance on vertical scroll position the animation will last (default: the window visible height)
  • to-scroll: vertical scroll position the animation ends (default: from-scroll + distance)
  • smoothness: factor that slowdown the animation, the more the smoothier (default: 30)

Exemple

    <div data-parallax='{"x": 650, "from-scroll": 90, "distance": 0}'>Number One</li>