Giter Club home page Giter Club logo

parallaxer.js's Introduction

parallaxer.js

HTML/JavaScript smooth parallaxe effect library orginally developed for Boy-Coy.

This library is under development. API may change.

Usage

Dependences

  • jQuery
  • Modernizr
  • requestAnimationFrame polyfill (for older browsers only)

Download

To download parallaxer.js you can use bower:

bower install parallaxer.js

Bower will also download dependences.

Alternatively, you can manually download the minified library (can be found in dist directory).

Use

Having .js files in place you can include them in your HTML.

<script src="bower_components/parallaxer.min.js"></script>

Don't forget to include dependences.

Now you can add data attributes to HTML elements that will be parallaxed, e.g.:

<div data-parallaxer="enabled" data-parallaxer-speed="1"></div>
<div data-parallaxer="enabled" data-parallaxer-speed="0.5"></div>

Each element will create separate parallaxe layer. Value of data-parallaxer-speed argument will decide how fast each element will move relatively to normal scroll speed.

Because of the nature of this parallaxe library all elements have to be "parallaxe enabled", otherwise they won't move as smooth as "parallaxe enabled" elements. If you want them to move with "normal" scroll speed just leave data-parallaxer-speed value set to 1.

Of course you can nest other elements in parallaxe enabled ones.

The last step is to call start method when HTML is loaded:

$('document').ready(function () {
    andrzejdus.parallaxer.Parallaxer.start();
});

Example

For simple usage example look to example directory.

Building

Prerequisites:

  • npm
  • grunt cli

Building:

npm install
grunt

Build output goes to dist directory.

parallaxer.js's People

Contributors

andrzejdus avatar

Watchers

James Cloos avatar Roshni Paul avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.