1.0.2 • Published 6 years ago

pparallax v1.0.2

Weekly downloads
16
License
MIT
Repository
github
Last release
6 years ago

pparallax

Precision parallax in ~1.6kb gzipped. Demo

js-standard-style

Install

npm i pparallax --save

// or window.pparallax

Usage

I need to build this out. Basically, the outer element is the direct parent of an absolutely positioned inner element. offset must be positive, and delays the start of the parallax effect to allow users to see the top of the image.

import pparallax from 'pparallax'

const outer = document.getElementById('outer')
const inner = document.getElementById('inner')
const instance = pparallax(outer, inner, {
  offset: 100 // default 0
})

instance.update()
instance.destroy()

Example

To run the example, clone this repo, then:

# move into example dir
cd srraf/example
# install deps
npm i
# compile JS
npm run js:build # or js:watch
# serve index.html and update with changes
live-server 

MIT License

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.1

7 years ago