• Stars
    star
    539
  • Rank 82,402 (Top 2 %)
  • Language
    JavaScript
  • License
    Other
  • Created over 11 years ago
  • Updated about 6 years ago

Reviews

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

Repository Details

A jQuery plugin that makes it easy to create paginated, feature vertically scrolling pages.

Demo and more information

About

ScrollIt.js(scroll•it•dot•js) makes it easy to make long, vertically scrolling pages. This is why it rocks:

  • Easy to implement: One JS call, just put data- attributes on the DOM
  • Lightweight: ~1kb minified
  • Active Class: Your navigation is updated automatically
  • Configurable: Set the animation easing, duration, callbacks and more
  • Keyboard Navigation: Press the up and down keys to move...

Usage

  1. Include jQuery and scrollIt.js
<script src="jquery-1.10.2.min.js" type="text/javascript"></script>
<script src="scrollIt.js" type="text/javascript"></script>
  1. Put a data-scroll-index attribute on each section
<div data-scroll-index="0">..content..</div>
<div data-scroll-index="1">...</div>
<div data-scroll-index="2">...</div>
  1. Put corresponding data-scroll-nav attributes on each nav
<a data-scroll-nav="0">About</a>
<a data-scroll-nav="1">Usage</a>
<a data-scroll-nav="2">Options</a>
  1. For links to sections, put on a data-scroll-goto attribute
<a data-scroll-goto="0">Back to top</a>
  1. Call scrollIt()
$(function(){
  $.scrollIt();
});

Options

To customize scrollIt.js, simply pass in an options object: (defaults shown)

$.scrollIt({
  upKey: 38,             // key code to navigate to the next section
  downKey: 40,           // key code to navigate to the previous section
  easing: 'linear',      // the easing function for animation
  scrollTime: 600,       // how long (in ms) the animation takes
  activeClass: 'active', // class given to the active nav element
  onPageChange: null,    // function(pageIndex) that is called when page is changed
  topOffset: 0           // offste (in px) for fixed top navigation
});

Credit

Created by @ChrisPolis, blog

Feel free to use, share and fork.

Enjoy!

More Repositories

1

smart-table-scroll

Build 1MM row tables with native scroll bars by reusing and yielding nodes.
JavaScript
538
star
2

Pagify

Effortlessly create single page web sites with this jQuery plugin.
JavaScript
487
star
3

datacomb

An interactive tool for exploring large, tabular datasets.
JavaScript
334
star
4

convertSTL

A utility for converting STL files between ASCII and binary encoding.
Ruby
74
star
5

hcluster.js

Agglomerative Hierarchical Clustering in JavaScript. (that plays nice with d3.js).
JavaScript
30
star
6

d3-annotate

📌 Interactively and programmatically add, edit, move and save SVG chart annotations.
JavaScript
22
star
7

Apples-and-Oranges

An online version of Apples to Apples built with JavaScript.
JavaScript
14
star
8

distance.js

Vector distance and similarity measurements in JavaScript. eg: Euclidean, Manhattan, Chebyshev, angular distance.
JavaScript
9
star
9

canvas-dpi-scaler

Utility to scale <canvas> for Retina and other high resolution screens.
JavaScript
9
star
10

us-town-names-vis

d3.js visualization prototype code used to build: http://www.bytemuse.com/post/us-town-names-canvas-d3/
JavaScript
8
star
11

Rails_Quiz

A quiz generator built with Ruby on Rails
Ruby
5
star
12

project_euler

Solutions to Project Euler written elegantly in Ruby.
Ruby
3
star
13

nba-seasons-vis

Visualization prototype code and phantomJS script used to build http://www.bytemuse.com/post/nba-games-played-win-record-vis/
JavaScript
3
star
14

Node-Users

A simple login system to demonstrate Node.JS and CouchDB
JavaScript
3
star
15

stl-utilities

Command line utility tools for working with STL/3D printing models.
C
2
star
16

zencms

A model oriented CMS for developers, designers and their clients.
Ruby
2
star
17

Simple-Commerce

A simple, lightweight and flexible Ruby on Rails based eCommerce system.
Ruby
2
star
18

shiny-quantmod-boilerplate

Boilerplate for creating finance applications with Shiny and Quantmod.
R
2
star
19

ractive-range-slider

Ractive component for a range slider composed of two native <input type=range> elements.
JavaScript
1
star
20

dotfiles

. files
Shell
1
star
21

angle

ANother Graphing Library written in d3.js and CoffeeScript
CoffeeScript
1
star
22

lets-explore-dataset-1

[Blog post, visualization development] Let's explore a dataset #1: Seasonality in Air Traffic Routes
1
star