PHPackages                             jcvb/parallaxjs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jcvb/parallaxjs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jcvb/parallaxjs
===============

parallax js efect

083JavaScript

Since Oct 19Pushed 10y ago1 watchersCompare

[ Source](https://github.com/jcvb/parallax.js)[ Packagist](https://packagist.org/packages/jcvb/parallaxjs)[ RSS](/packages/jcvb-parallaxjs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Parallax.js
===========

[](#parallaxjs)

Simple parallax scrolling effect inspired by [Spotify.com](http://spotify.com/) implemented as a jQuery plugin

Installation
------------

[](#installation)

Download and include `parallax.min.js` in your document after including jQuery.

```

```

Usage
-----

[](#usage)

### Via data attributes

[](#via-data-attributes)

To easily add a parallax effect behind an element, add `data-parallax="scroll"` to the element you want to use, and specify an image with `data-image-src="/path/to/image.jpg"`.

```

```

### Via JavaScript

[](#via-javascript)

To call the parallax plugin manually, simply select your target element with jQuery and do the following:

```
$('.parallax-window').parallax({imageSrc: '/path/to/image.jpg'});
```

### Notes

[](#notes)

What parallax.js will do is create a fixed-position element for each parallax image at the start of the document's body. This mirror element will sit behind the other elements and match the position and dimensions of its target object.

Due to the nature of this implementation, you must ensure that these parallax objects and any layers below them are transparent so that you can see the parallax effect underneath. Also, if there is no other content in this element, you will need to ensure that it has some fixed dimensions otherwise you won't see anything.

```
.parallax-window {
	min-height: 400px;
	background: transparent;
}
```

Also, keep in mind that once initialized, the parallax plugin presumes a fixed page layout unless it encounters a `scroll` or `resize` event. If you have a dynamic page in which another javascript method may alter the DOM, you must manually refresh the parallax effect with the following commands:

```
jQuery(window).trigger('resize').trigger('scroll');
```

Options
-------

[](#options)

Options can be passed in via data attributes of JavaScript. For data attributes, append the option name to `data-`, as in `data-image-src=""`.

Note that when specifying these options as html data-attributes, you should convert "camelCased" variable names into "dash-separated" lower-case names (e.g. `zIndex` would be `data-z-index=""`).

   Name type default description     imageSrc path null You must provide a path to the image you wish to apply to the parallax effect.   naturalWidth number auto You can provide the natural width and natural height of an image to speed up loading and reduce error when determining the correct aspect ratio of the image.   naturalHeight number auto   position xPos yPos center center This is analogous to the background-position css property. Specify coordinates as top, bottom, right, left, center, or pixel values (e.g. -10px 0px). The parallax image will be positioned as close to these values as possible while still covering the target element.   positionX xPos center   positionY yPos center   speed float 0.2 The speed at which the parallax effect runs. 0.0 means the image will appear fixed in place, and 1.0 the image will flow at the same speed as the page content.   zIndex number -100 The z-index value of the fixed-position elements. By default these will be behind everything else on the page.   bleed number 0 You can optionally set the parallax mirror element to extend a few pixels above and below the mirrored element. This can hide slow or stuttering scroll events in certain browsers.   iosFix boolean true iOS devices are incompatable with this plugin. If true, this option will set the parallax image as a static, centered background image whenever it detects an iOS user agent. Disable this if you wish to implement your own graceful degradation.   androidFix boolean true If true, this option will set the parallax image as a static, centered background image whenever it detects an Android user agent. Disable this if you wish to enable the parallax scrolling effect on Android devices.   overScrollFix boolean false (Experimental) If true, will freeze the parallax effect when "over scrolling" in browsers like Safari to prevent unexpected gaps caused by negative scroll positions.  Contributing
------------

[](#contributing)

If you have a pull request you would like to submit, please ensure that you update the minified version of the library along with your code changes. This project uses [uglifyjs](https://www.npmjs.com/package/uglify-js) to perform code compression.

Please use the following command:

```
uglifyjs parallax.js --comments -m -c -o parallax.min.js

```

LICENSE
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2015 PixelCog Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b6c668c71cb53e95ffb544d47032897db807eb26f78f37fd96e188cac872fb71?d=identicon)[jcvb](/maintainers/jcvb)

---

Top Contributors

[![mikegreiling](https://avatars.githubusercontent.com/u/812328?v=4)](https://github.com/mikegreiling "mikegreiling (32 commits)")[![jcvb](https://avatars.githubusercontent.com/u/1750667?v=4)](https://github.com/jcvb "jcvb (1 commits)")[![mrclay](https://avatars.githubusercontent.com/u/170687?v=4)](https://github.com/mrclay "mrclay (1 commits)")[![sebslomski](https://avatars.githubusercontent.com/u/739310?v=4)](https://github.com/sebslomski "sebslomski (1 commits)")[![taavilarionov](https://avatars.githubusercontent.com/u/2972990?v=4)](https://github.com/taavilarionov "taavilarionov (1 commits)")

### Embed Badge

![Health badge](/badges/jcvb-parallaxjs/health.svg)

```
[![Health](https://phpackages.com/badges/jcvb-parallaxjs/health.svg)](https://phpackages.com/packages/jcvb-parallaxjs)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
