data-speed, data-type) in HTML.
Core Options
string
default:"scroll"
The type of parallax effect to apply.Available values:
scroll- Standard parallax scrolling effectscale- Scale effect as the element comes into viewopacity- Fade effect based on scroll positionscroll-opacity- Combined scroll and opacity effectscale-opacity- Combined scale and opacity effect
number
default:"0.5"
Controls the speed and direction of the parallax effect. Accepts values from
-1.0 to 2.0.- Negative values (
-1.0to0) reverse the scroll direction 0.5creates a natural parallax effect (half the scroll speed)1.0scrolls at the same speed as the page (no parallax)- Values above
1.0create a faster-than-scroll effect
string
default:"jarallax-container"
CSS class attribute applied to the parallax container element.The container is the wrapper element created by Jarallax to hold the parallax image.
string
default:"null"
URL of the image to use as the parallax background.By default, Jarallax uses the image from the element’s CSS background-image property or a child
.jarallax-img element.string | Element
default:".jarallax-img"
DOM element or CSS selector for the image tag to use as background.Can be:
- A CSS selector string (e.g.,
.jarallax-img) - A DOM element reference
- An
<img>or<picture>tag
string
default:"cover"
Defines how the background image should be sized.
- When using
<img>tag: accepts CSSobject-fitvalues (cover, contain, fill, none, scale-down) - When using background image: accepts CSS
background-sizevalues (cover, contain, auto, or specific dimensions)
string
default:"50% 50%"
Controls the positioning of the background image.
- When using
<img>tag: accepts CSSobject-positionvalues - When using background image: accepts CSS
background-positionvalues
center center, top left, 50% 50%, or any valid position value.'repeat' | 'no-repeat'
default:"no-repeat"
Determines whether the background image should repeat.Only supports CSS
background-repeat values. Works only with background images, not <img> tags.boolean
default:"false"
When
true, keeps the original <img> tag in its default place after Jarallax initialization.By default, Jarallax moves the image element into the parallax container. This option clones the image instead, leaving the original in place.Element | JQuery<Element>
default:"null"
Custom DOM or jQuery element used to check if the parallax block is in the viewport.Useful for parallax elements inside scrollable containers or custom scroll implementations.See GitHub Issue #13 for more details.
number
default:"-100"
The z-index value applied to the parallax container.By default, the parallax background is placed behind the content with a negative z-index.
boolean | RegExp | function
default:"false"
Disable parallax effect on specific user agents or conditions.Can be:
boolean:trueto completely disable parallaxRegExp: Regular expression to test againstnavigator.userAgentfunction: Custom function that returnstrueto disable parallax
Data Attribute Usage
All options can be set via data attributes in HTML:Data attributes are automatically converted to options. For example,
data-speed becomes the speed option.
Boolean strings (‘true’ and ‘false’) are automatically converted to actual boolean values.