GithubHelp home page GithubHelp logo

hoakusa / ng-parallax Goto Github PK

View Code? Open in Web Editor NEW

This project forked from allenjynroyston/ng-parallax

0.0 2.0 0.0 362 KB

Parallax made easy for Angularjs

JavaScript 27.52% CSS 2.64% HTML 69.84%

ng-parallax's Introduction

ng-parallax

CDNJS

Ng2 Version

There is a Angular2 directive, but I haven't really been vigiliant about updating it. (I'm only one person - sorry).

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.3

Updates

  • v1.1.3 - Merged changes from emelent.
  • v1.1.3 - Added support for use in Webpack/ComponentJS
  • 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="./src/ngParallax.min.js"> <script>

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

or include just like any other component in Webpack

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.

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.