2.0.1 • Published 8 years ago

parallaxy v2.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

What it is

Adds parallax effect to images and videos.

Installation

parallaxy.js is available as an npm package.

npm install parallaxy --save

Add parallaxy.min.js to the bottom of the <body> like this:

<script src="parallaxy.min.js"></script>

Note

This is an very early version of parallaxy.

How to Use

Usage

In this example the image will have a parallaxy effect.

<div data-parallaxy>
	<img src="image.jpg">
	<div data-parallaxy-ignore>
		<h1>Content above</h1>
	</div>
</div>

After DOM change

If the DOM has changed and you want to reset Parallaxy, just run;

Parallaxy.refresh();

Options

Options must be passed via data-attributes. Append the option name to data-parallaxy-, as in data-parallaxy-speed="0.25".

NameTypeDefaultDescription
speedFloat0.5Adjust parallaxy effect from 0-1 (none-max)
ignoreBooleanfalseIgnore parallaxy effect on this element

Global options (data-attribute):

NameTypeDefaultDescription
ignoresmoothscrollBooleannullIgnore smoothMouseWheel. Place anywhere

Browser Support

Coming soon. Uses CSS translate2D to scale and position images.

License

The code is available under the MIT License.

2.0.1

8 years ago

2.0.0

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago