1.0.2 • Published 8 years ago

dothiswhenvisible v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

doThisWhenVisible

A small jQuery plugin to execute a callback when an element is above the bottom of the viewport.

Usage

doThisWhenVisible is a jQuery plugin, so make sure you have jQuery on the page before you include this.

<script src="//code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="path/dist/jquery.dothiswhenvisible.min.js"></script>

Then you just need to get a hold of the element(s) you want to monitor and call doThisWhenVisible, passing in your callback.

jQuery('.target').doThisWhenVisible(function($el){
    console.log('It would appear that ', $el, ' is now visible');
});
1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago