parallax

CSS-based parallax. Elements with data-parallax inside each slide move at a fraction of the slide scroll speed, creating depth.

Import

import { parallax } from '@andresclua/sliderkit-plugins'

Usage

new Slider('#el', {
  plugins: [parallax({ depth: 0.3 })],
})

// HTML: add data-parallax to inner elements
// <div data-parallax class="slide-bg"></div>

Options

OptionTypeDefaultDescription
selectorstring'[data-parallax]'Selector for parallax elements inside slides.
depthnumber0.3Parallax multiplier. Higher = more movement.

Demo

View parallax demo →