Socket
Socket
Sign inDemoInstall

paroller.js

Package Overview
Dependencies
1
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    paroller.js

Parallax scrolling jQuery plugin


Version published
Maintainers
1
Install size
1.22 MB
Created

Readme

Source

paroller.js

npm

A lightweight jQuery plugin that enables parallax scrolling effect

  • You can use it on elements with background property or on any other element
  • While scrolling elements can move: vertical, horizontal
  • Manipulated through html data-* attributes or jQuery options
  • Mobile ready
  • Easy to use

DEMO: Example page, Alveus

Install

Before closing </body> element include:

  1. jQuery
  2. jquery.paroller.js
npm
$ npm install paroller.js
Bower
$ bower install paroller.js
Yarn
$ yarn add paroller.js

Use

// initialize paroller.js 
$('.my-paroller').paroller();
// initialize paroller.js and set attributes 
$("#my-element").paroller({ factor: '0.5', type: 'foreground', direction: 'horizontal' });
<!-- select element -->
<div class="my-paroller" data-paroller-factor="0.3" data-paroller-type="foreground" data-paroller-direction="horizontal"></div> 
<div id="my-element"></div>

npm and browserify

require('paroller.js');

Options

data attributes

You can control scrolling parallax effect by setting data-paroller-* values attributes or by setting JavaScript options.

data-paroller-factor sets speed and distance of element's parallax effect on scroll.

data-*valuedefault value
data-paroller-factorsets offset and speed. It can be positive (0.3) or negative (-0.3). Less means slower.0
data-paroller-typebackground, foregroundbackground
data-paroller-directionvertical, horizontalvertical

JavaScript

// initialize paroller.js and set attributes for selected elements
$(".paroller, [data-paroller-factor]").paroller({
    factor: 0.3,            // multiplier for scrolling speed and offset, +- values for direction control
    type: 'foreground',     // background, foreground
    direction: 'horizontal' // vertical, horizontal
});
                

License

MIT

Keywords

FAQs

Last updated on 02 Mar 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc