jQuery plugin, fires events when an element's visibility changes
JavaScript Other
Switch branches/tags
Nothing to show
Pull request Compare This branch is 1 commit behind dmcquay:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
README.markdown
example.html
visibilityTracker.js

README.markdown

#VisibilityTracker

Fires an event as elements scroll through the viewport (viewable area of the browser window). Read the VisibilityTracker documentation for more information.

#Synopsis

jQuery(document).ready(function(){
    var pEls = document.getElementsByTagName('p');
    jQuery(pEls).bind('visibility-status-change', function(evt, visibilityStatus) {
        if (visibilityStatus.isLastVisible()) {
            jQuery(evt.target).addClass('lastVisible');
        } else {
            jQuery(evt.target).removeClass('lastVisible');
        }
    });
    new VisibilityTracker(pEls);
});