Installation
Jarallax’s jQuery plugin is included in the UMD build. Include jQuery before Jarallax:jQuery integration is only available with the UMD build. ESM builds do not include jQuery support.
Basic Usage
Initialize Jarallax using jQuery selectors:Complete Example
Here’s a full working example with jQuery:jQuery Selectors
Use jQuery’s powerful selectors to target specific elements:Configuration Options
Pass options as an object to customize the parallax effect:Methods
Call methods on existing Jarallax instances using jQuery:- Destroy
- isVisible
- onResize
- onScroll
Remove parallax effect and restore original state:
Event Handling
Attach event handlers when initializing or after initialization:1
Initialization Events
Pass event handlers as options:
2
Scroll Events
Monitor scroll calculations:
3
Custom Events
Use jQuery’s event system for additional functionality:
No Conflict Mode
Prevent namespace collisions when using multiple jQuery plugins:Video Backgrounds
Jarallax with jQuery supports YouTube, Vimeo, and self-hosted videos:Multiple Parallax Instances
Apply different settings to different elements:Chaining Methods
Use jQuery chaining for cleaner code:Dynamic Initialization
Initialize parallax on dynamically added elements:Advanced Patterns
- Conditional Initialization
- Responsive Speed
- Toggle Parallax
- Progress Indicator
Initialize only on desktop devices:
Working with AJAX
Handle parallax in AJAX-loaded content:Troubleshooting
jQuery is not defined
jQuery is not defined
Ensure jQuery is loaded before Jarallax:
Method not working
Method not working
Check that Jarallax is initialized before calling methods:
Multiple initialization
Multiple initialization
Prevent double initialization:
Best Practices
1
Use document.ready
Always initialize Jarallax after DOM is ready:
2
Clean up on destroy
Remove parallax when elements are removed:
3
Cache selectors
Store jQuery objects for better performance:
Migration from Vanilla JS
If you’re migrating from vanilla JavaScript:Next Steps
Vanilla JavaScript
Learn Jarallax without jQuery
React & Next.js
Integrate with modern React applications
API Reference
Explore all available methods and options
Configuration
Advanced configuration options
