Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
jQuery plugin, fires events when an element's visibility changes
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

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