goodparallax

2.1.2 • Public • Published

GoodParallax

Very simple and easy to use parallax animation plugin.

Demo

Play with demo here: Demo

Features

  • Smooth work;
  • Very easy to set up and play;
  • No jQuery. Plugin has been coded on pure JavaScript;
  • Mobile phone support

How to use

  • just include the plugin to your project...
<script src="dist/good-parallax.min.js"></script>
  • init the plugin
new GoodParallax().init();
Next, we need to add class .parallax to an element and provide a link for your image:
 <section class="parallax" data-img="img/path_to_your_image"></section>
You can use package managers to install the plugin:
  • From NPM:
npm install GoodParallax

Customize The Plugin

You can change the parallax speed or use different class.

// Plugin customization
new GoodParallax().init({
    speed: 8.0
});
Avalaible Options
Key Default value Description
speed 5.0 Set the parallax animation speed. Higher number - slower effect
className parallax Use your own class for parallax animation

Some tips and recomendations

  • You can skip the data-img attribute and add the image via backgroud-image property from CSS. That's more proper way either js blocks the image rendering
  • Compress and shrink your images. In my opinion, FullHD is enough for size.
  • For mobile devices are more properly to include image with more smaller size, for example, not more than 768px by width.

Hope you like it :)

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.1.22latest

Version History

VersionDownloads (Last 7 Days)Published
2.1.22
2.0.20
2.0.10
2.0.01
1.0.40
1.0.30
1.0.20

Package Sidebar

Install

npm i goodparallax

Weekly Downloads

3

Version

2.1.2

License

MIT

Last publish

Collaborators

  • svyatik