Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 719 Bytes

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);
});
Something went wrong with that request. Please try again.