0.0.3 • Published 8 years ago

client-rect-notifications v0.0.3

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

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/