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
| Option | Type | Default | Description |
|---|---|---|---|
selector | string | '[data-parallax]' | Selector for parallax elements inside slides. |
depth | number | 0.3 | Parallax multiplier. Higher = more movement. |