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

hongkong

v1.4.0

Published

jQuery based plugin for parallax scrolling

Downloads

15

Readme

Hongkong - jQuery based plugin for parallax scrolling

Build Status Dependency Status devDependency Status

Install via npm

npm i --save hongkong

Usage

Please add bin/hongkong.js to your website. Make sure to include the dependency jQuery.

<script src="node_modules/jquery/dist/jquery.js"></script>
<script src="node_modules/hongkong/bin/hongkong.js"></script>

Just add the attribute data-parallax. For directions of the "floating" element please use data-parallax-top or data-parallax-bottom.

You can add a data-parallax-factor with a value which is an integer to change the factor of which the element should move. Default is 4.

Then call

$.hongkong();

somewhere within your JavaScript.

[ES6 | ES2015 | ES2016 | ES2017] modules

With ES6 you can use Hongkong as follows:

import $ from 'jquery';
import hongkong from 'hongkong';

hongkong($);
$.hongkong();

Options

You can pass options to Hongkong to customize it a bit:

  • factor: default factor to use for momentum if no other is set via a data-attribute; default: 4
  • mobile: support parallax effect on mobile; default: false
  • mediaQuery: Media query to match against when disabling parallax on mobile; default: (max-width: 42em)
  • selector: Selector to use to detect elements that should be scrolled; default [data-parallax]
  • threshold: Set threshold for showing and hiding elements; default 0

Data attributes

  • data-parallax-top
  • data-parallax-bottom
  • data-parallax-position-x
  • data-parallax-factor
  • data-parallax-remove-initial-offset
  • data-parallax-remove-general-offset

Development

Run npm i inside this folder. Start a development server with npm start.

License

The MIT License (MIT) Copyright (c) 2014 Hans Christian Reinl