A javascript library that handles the nuances of the dom scroll api
Switch branches/tags
Nothing to show
Clone or download
Latest commit 4f5a8a7 Feb 5, 2014
Permalink
Failed to load latest commit information.
tests ingorie node_modules Feb 5, 2014
.gitgnore gitgnore Jun 28, 2013
.gitignore ingorie node_modules Feb 5, 2014
.project api chagne Jun 27, 2013
Gruntfile.js added grunt Feb 5, 2014
README.md updated docs, added _pageCurrent Jul 5, 2013
license.txt added license Jun 29, 2013
package.json added grunt Feb 5, 2014
scroll.js updated docs Feb 5, 2014

README.md

Scroll.js

Scrolljs aims to make it easy to detect if an element can be scrolled, get the current scroll position and provide utility methods that are commonly needed.

Examples

var target = jebaird.scroll( document.getElementById( 'target' ) );

if( target.scrollableVert() ){
	alert('we can scroll up and down' )
}

in event handlers, using jquery bind events

var $target $('#target');
var scroll = jebaird.scroll( $target[ 0 ] );


target.bind('scroll', function(){
	var vert = scroll.direction().vert
	if(  vert == -1 ){
		//scrolling up, so do something fancy
	}else if( vert == 1 ){
		//scrolling down, do something extra snazzy
	}

});