• Stars
    star
    276
  • Rank 149,319 (Top 3 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 11 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A ScrollSpy library for detecting enter/exit of elements in the viewport when the user scrolls

jquery-scrollspy

A jQuery plugin for detecting enter/exit of elements in the viewport when the user scrolls.

New Features

Added a couple new features:

  • May 2014 - optional window offset, allows for things like floating navs
  • Feb 2014 - supports window resize
  • Nov 2013 - throttles scrollspy events so that event handles only fire every 100 milliseconds

Usage

$('.tile').on('scrollSpy:enter', function() {
	console.log('enter:', $(this).attr('id'));
});

$('.tile').on('scrollSpy:exit', function() {
	console.log('exit:', $(this).attr('id'));
});

$('.tile').scrollSpy();

// or you could do this:
// $.scrollSpy($('.tile'));
// or this
// $('.tile').each(function(i, element) {
// 		$.scrollSpy(element);
// });

Window Resize

Use the scrollSpy:winSize event for watching window resize. This fires any time the window is resized by the user.

$.winSizeSpy().on('scrollSpy:winSize', funcy)

Contributions

Please provide pull requests for additional features. Test cases would be most weclome!

Thank you contributors:

More Repositories

1

js-hypercube

An n-dimensional database, useful for aggregation and charting analytics
JavaScript
25
star
2

php-dotty

Access array data quickly using dot notation
PHP
12
star
3

php-atwood

Atwood PHP 5.3+ Framework
PHP
4
star
4

php-bitfield

Map an array of options to a binary bitfield as a string or integer, and back again.
4
star
5

php-singleton

Singleton pattern for php, with optional support for named singletons
PHP
3
star
6

pyspotify-playlist-generator

This is a playlist generator script of PySpotify and libspotify. It currently doesn't work, and serves as an example for a fix from the industry and community.
Python
3
star
7

nodash

A partial port of lodash and test suit to TypeScript for the Deno JavaScript runtime.
TypeScript
3
star
8

node-hyper

An n-dimensional database, written in JavaScript, useful for aggregation and charting analytics.
JavaScript
3
star
9

git-rebase-cheat-sheet

A cheat sheet for learning how to manage branch development using rebase.
3
star
10

php-environment

Easily manage database connection strings or other configuration data that changes between different server environments like dev and prod
PHP
3
star
11

php-topsy

A php rest client for Topsy's Otter API with support for rate limiting and error handling
PHP
2
star
12

php-url

Create, manipulate, and output any URL easily. Convert between relative and absolute URLs. Map URLs to their canonical equivalent.
PHP
2
star
13

php-SuperPack

A package management tool that optimizes CSS and JavaScript download times
PHP
1
star
14

php-stache

A container for persisting key-value pairs using Memcached, MongoDb, or native-php
1
star