This plugin can be used to prevent unnecessary processeing for content that is hidden or is outside of the browser viewport.
It implements a custom appear/disappear events which are fired when an element became visible/invisible in the browser viewport.
$('someselector').appear(); // It supports optional hash with "force_process" and "interval" keys. Check source code for details.
$('<div>test</div>').appear(); // It also supports raw DOM nodes wrapped in jQuery.
$('someselector').on('appear', function(event, $all_appeared_elements) {
// this element is now inside browser viewport
});
$('someselector').on('disappear', function(event, $all_disappeared_elements) {
// this element is now outside browser viewport
});
Website