Skip to main content
Jarallax provides seamless jQuery integration, allowing you to use familiar jQuery syntax for initializing and controlling parallax effects. This integration is perfect for projects already using jQuery or requiring legacy browser support.

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:
With custom options:

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:
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:
Call noConflict() immediately after loading Jarallax and before any other code that might use $.fn.jarallax.

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

Initialize only on desktop devices:

Working with AJAX

Handle parallax in AJAX-loaded content:

Troubleshooting

Ensure jQuery is loaded before Jarallax:
Check that Jarallax is initialized before calling methods:
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