angular-scrollstop

AngularJS scrollstop and scrollstart events.
Homepage:
0 people use it
Author: 7130591?v=2 HHogg
Submitted by: 7130591?v=2 HHogg

angular-scrollstop

Simple AngularJS service and directives for detecting when a user has stopped and started scrolling.

Demo

Have a look at both of them in action , demo here.

Install

Bower: $ bower install angular-scroll

Remeber to add hg.scrollstop to your module dependencies :wink:

Service hgScrollEvent

The hgScrollEvent service provides two functions; scrollstart and scrollstop. Each can execute a callback and broadcast an event down the scope of the element the event is attached to.

.scrollstop([element [, callback] ]);

.scrollstart([element [, callback] ]);

Pass an element as the first argument to attach the scroll event to, and a callback function as the second argument.

... or just pass a callback function and the event will be attached to $document

... or just pass an element and it will broadcast the event down the scope and perform no callback.

... or supply no arguments to broadcast the event when the document is scrolled.

Just listen for the event like you would with any other, with the angular event, scroll event, and the attached elment provided in the callback.

Directives

Two directives are provided to easily use the scrollstop and start events on elements. The events are binded to the element they are used on and can be provided (or not) a callback function.

hg-scrollstart

hg-scrollstop

comments powered by Disqus
This page was last updated almost 3 years ago.