client-rect-notifications
v0.0.3
Published
Provides notifications for changes in the position of an HTML element relative to the viewport.
Downloads
6
Maintainers
Readme
client-rect-notifications
Provides notifications for changes in the position of an HTML element relative to the viewport.
Demo
Install
$ npm install --save-dev client-rect-notifications
Usage
var htmlElement = ...;
var clientRectNotifications = require('client-rect-notifications');
clientRectNotifications.add(
htmlElement ,
{
completelyOutOfView : function() {
// do something
},
completelyInView : function() {
// do something
},
mostlyInView : function() {
// do something
},
partiallyInView : function() {
// do something
}
}
);
Build
$ git clone ...
$ npm install
$ grunt serve
// Deployed to http://localhost:9001/