Installation
Install Jarallax via npm:Initialization Methods
Jarallax supports three initialization patterns in vanilla JavaScript:- ESM Import
- UMD Script
- Data Attributes
Use ES Modules for modern JavaScript applications with bundlers or native browser support.
The video extension is optional and only needed if you want to use YouTube, Vimeo, or self-hosted video backgrounds.
Complete Examples
ESM with CDN
Here’s a complete working example using ES Modules from a CDN:UMD with Script Tags
This example uses traditional script tags for maximum browser compatibility:Data Attribute Initialization
Use data attributes for zero-JavaScript initialization:HTML Structure
Jarallax requires specific HTML structure for the parallax effect to work:Configuration Options
Customize the parallax effect with these options:Methods
Control parallax instances programmatically:Events
Listen to parallax events for custom behaviors:Video Backgrounds
Jarallax supports YouTube, Vimeo, and self-hosted video backgrounds:Browser Support
Jarallax works in all modern browsers:- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Opera (latest)
For older browsers, the UMD build provides the best compatibility. ESM requires browsers with native ES6 module support.
Next Steps
React & Next.js
Learn how to integrate Jarallax with React and Next.js applications
jQuery Integration
Use Jarallax with jQuery for enhanced compatibility
API Reference
Explore all available methods and options
Advanced Usage
Discover advanced configuration and customization options
