🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

visibilityChanged is a lightweight and cross-browser jQuery plugin that determines if a specific element is visible and executes a callback function when the element gets hidden or visible in DOM.

callback Viewport Visibility

Documentation

jquery.visibilityChanged

Executes a callback when an element's visibility changes

Example: http://jsfiddle.net/shaunbowe/kb24kqfx/4/

$("#tester").visibilityChanged({     callback: function(element, visible, initialLoad) {        // do something here        // element: the element in question        // visible: (bool) if the element is currently visible        // initialLoad: (bool) if the callback is being trigger for the        //   first time on an element (i.e. on page load)     },     runOnLoad: false,     frequency: 100 });

You May Also Like