parallax-scroll-component
v1.0.4
Published
A smooth parallax scrolling component
Downloads
17
Maintainers
Readme
Parallax Scroll Component
A smooth parallax scrolling component for modern web applications.
Installation
npm install parallax-scroll-componentUsage
import ParallaxScroll from 'parallax-scroll-component';
const images = [
'path/to/image1.jpg',
'path/to/image2.jpg',
'path/to/image3.jpg'
];
const parallax = new ParallaxScroll('#container', {
images: images,
transitionDuration: 800, // optional, default 800ms
easing: 'ease-in-out' // optional, default 'ease-in-out'
});
// Programmatic control
parallax.next(); // Go to next slide
parallax.prev(); // Go to previous slide
parallax.goTo(1); // Go to specific indexOptions
| Option | Type | Default | Description | |--------|------|---------|-------------| | images | Array | [] | Required. Array of image URLs | | transitionDuration | Number | 800 | Animation duration in milliseconds | | easing | String | 'ease-in-out' | CSS transition timing function |
Methods
next(): Go to next slideprev(): Go to previous slidegoTo(index): Go to specific slide index
License
MIT
