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

jquery-scroll-indicator-bullets

v2.0.0

Published

JQuery plugin to create a scroll indicator bullet navigation on the right side of the screen.

Downloads

17

Readme

JQuery Scroll Indicator Bullets

A JQuery plugin to create a scroll indicator bullet navigation on the right side of the screen.

Requirements

  • Requires the library Waypoints.
  • Optionally: Modernizr for a more convenient handling of the titles on touch devices.

Usage

The plugin creates bullets for all matching DOM elements that contain an ID. The order of the bullet points reflects the order of the elements in the DOM. Therefore the plugin works best with a set of vertically stacked divs.

$('div.page-section').scrollIndicatorBullets();

Options

An object defining a number of the following options may be passed to the plugin:

  • titleSelector - String [null]

    A Selector to retrieve the element's title. The textual content of the first element in the selection is displayed next to the bullet on mouseover.

  • scrollDuration - int [400]

    Duration in ms of the scroll animation.

  • touchTitleDelay - int [500]

    Delay in ms for showing the titles on touch devices.

  • scrollOffset - int [50]

    The offset from the top of the screen to the scrolled section when clicking on the bullet.

  • waypointOffsetDown - int [window.innerHeight/3]

    When scrolling down: A section becomes active as soon as the top of the block is this far up the screen.

  • waypointOffsetUp - int [50]

    When scrolling up: A section becomes active as soon as the top of the block is this far down the screen.

  • pgKeysEnabled - boolean [true]

    Should pageUp and pageDown keys trigger the jumps inside the navigation?

$('div.page-section').scrollIndicatorBullets({
  titleSelector: '.title,.subtitle'
});

API

The plugin returns an object with a set of functions:

  • scrollToNext() - Scroll to the next section if there is one.

    This function returns false if there was no next section to scroll to, so the caller can decide on what to do.

  • scrollToPrev() - Scroll to the previous section if there is one.

    This function returns false if there was no previous section to scroll to, so the caller can decide on what to do.

var scrollIndicatorApi = $('div.page-section').scrollIndicatorBullets();

$('.scroll-button').click(function () {
    scrollIndicatorApi.scrollToNext();
});

Demo

See the Github Pages for a demo of the bullet navigation.