Git Product home page Git Product logo

parallaxtouch.js's Introduction

parallaxTouch.js

Mobile and browser based parallax effect.

Requirements

parallaxTouch.js current relies on jQuery 1.7.2 for DOM-manipulations. This requirement is likely to be removed in a future release.

You must include jQuery 1.7.2 as a script.

Use

To use parallaxTouch.js:

<script src="lib/parallaxTouch.js"></script>
<link rel="stylesheet" href="lib/parallaxTouch.css">

Optionally, if you have large resolution images:

<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>

Create your DOM structure, and define options using data attributes. Each parallax layer much have it's own first-level child in your parallax base. Images should be numbered from 0 in the data-src

<div id="parallax" width="IMAGE_WIDTH" height="IMAGE_HEIGHT">
	<div></div>
	<div></div>
	<div></div>
</div>

Data attributes are:

attribute definition example
src path to background images to use required data-src="demo"
mime mime extension to use optional: png is default data-mime="jpg"
easing easing factor to use for parallax transition required data-easing="10"

Then initialize the parallax effect on your parallax base element

$('div#parallax').parallax()

parallaxtouch.js's People

Contributors

enmand avatar awatraised avatar

Watchers

James Cloos 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.