npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

saparallax

v1.3.5

Published

A little jQuery Plugin that adds a customizable Parallax Scrolling Effect to any element.

Downloads

2

Readme

SA(scollimate) Parallax

SA PARALLAX SAMPLE

(This version was pulled from as a standalone version from scrollimate )

ABOUT:

Parallax Scrolling simply means that as you scroll down the page, elements (usually in the background) scroll slower than the foreground, giving an impression of depth and space. This is the same effect that, when riding a train, makes trees zoom past at seemingly high speed, while the mountains in the background seem to move by much slower, and clouds appear almost stationary.

BASIC SETUP:

1.) Select the elements which you want to scroll at a slower speed:

Add the following custom Data-Attribute to the element that is supposed to scroll slower.

data-sabglayer

Alternatively, you can also keep using the old data-attribute

data-bglayer

Just make sure you use one or the other, but not both :)

2.) In the body, right before the footer: Include jQuery. Include saparallax.js.

<script src="path/to/your/scripts/jquery-2.1.4.min.js"></script>
<script src="path/to/your/scripts/saparallax.js"></script>

That's it!

Have fun parallaxing around!

ADVANCED SETUP:

You can tell the data-sabglayer attribute how your parallax animation should behave. By Default, it will simply start at the top and will scroll at half the speed that the page once you start scrolling. The data-sabglayer will take two arguments:

Adjust scroll speed

  • Supply a single number like so: data-sabglayer="0.5"

Supply it a single number, this is the speed at which you want the element to scroll relative to the page speed. To create several layers of parallax, or simply to more fine-tune the effect, you can se the data-sabglayer attribute to any floating point value between 0 (which will cause the element to scroll normally) and 2 (which will cause the element to appear static on the page).

You can also use any number larger than 2, which will cause the element to scroll in the opposite direction of the scroll. And yes, you can also use negative numbers and make the element scroll faster than the page!

Centering / Offset Control

SA PARALLAX SAMPLE

See how in this example, the top hero-image parallaxes right away, but each following elements (images) only when it comes into view, and consistently for each element? SA Parallax can do that!

You can supply more than one argument to SA Parallax. This is useful if the element you wish to parallax is not at the top. Supplying two elements will cause the eement to only start parallaxing once in view.

NEW in 1.3:

Keep Elements Centered

  • Supply two arguments (separated by comma), with the second argument set to center like so: data-sabglayer="-0.5, center"

This will calculate the parallax so that the element will be in it's “ideal” position when centered vertically on the screen. Plus, (ideally) you would never see it parallax out of view in either direction. (Mileage may vary...)

Custom Offset Elements

  • Supply a second argument separated by comma like so: data-sabglayer="-0.5, 0.25"

With this, you can define the position of parallaxing element. This is useful if you want the fine-control the element’s be position. This number is the fraction it is offset by it’s own hight. For example, 0.5 on a 500px tall element will cause it to be offset by 250px, 1 by 500px, etc.

If you don't want the element to be offset, but not start parallaxing until in view, simply set the second number to 0, like so: data-sabglayer="1.5, 0"

MOBILE CONTROL

By default, parallax will not be enabled on screen sizes smaller than 768px. (Sidenote: This applies to initial screen-size: Whatever your page loaded with, determined whether or not parallax is enabled. This is by design so that check is not performed over and over).

You can re-enable mobile parallax by calling the enableMobile before the saParallax method like so: <script> scrollimate.init(['enableMobile', 'saParallax']); </script> (If you are running the init function with other methods the order doens't matter, as long as saParallax gets called last).