Skip to content

rickyzicky/ng-parallax

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ng-parallax

What Am I?!

An easy way to implement parallax scrolling with Angularjs.

  • No dependencies
  • Responsive
  • Simple
  • Works for mobile! (Well, iPhones at least - haven't tested on an Android yet)
  • Tiny (only 292B)

Usage

<div ng-parallax pattern="myPattern" speed="0"> < /div>

Version

1.1.2

Updates

  • v1.1.2 - Eliminated jankiness when using Macbook touchpads and touchscreens.

Live Demo

Check it out

Dependencies

  • None! (Other than AngularJS).

NPM / Bower

npm install ng-parallax --save-dev
bower install ng-simple-parallax --save

Installation

Include the module in your scripts.
<script src="./js/ngParallax.min.js"> <script>

Add ngParallax in your apps dependencies.
var app = angular.module('myApp', ['ngParallax']);

Parameters

<div ng-parallax pattern="'imageLocation'" speed="[0-3]" reverse="[true/false]"> < /div>

speed: 0-3 (slowest to fastest)
  • Setting the speed at 0 will lock the image in place.
  • ... unless it's iOS, in which case the image will act as a static image and scroll naturally.
  • Using negative numbers reverses the direction.
  • The speed is directly related to the image size, so tinker with your speed to get the right effect.

License

MIT - go nuts y'all.

About

Parallax made easy for Angularjs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 58.8%
  • JavaScript 39.0%
  • CSS 2.2%