Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
jQuery plugin allowing you to specify a callback to execute when an element is scrolled into view. The plugin is less than 1kb unminified and uses jQuery's Deferred Object API
branch: master
Failed to load latest commit information.
test Add Travis CI config & minor updates
.gitignore Add Travis CI config & minor updates
.travis.yml Add Travis CI config & minor updates
LICENSE.txt Add Travis CI config & minor updates
README.md Add CI build status image to README.md
Rakefile
example-usage.html Add Travis CI config & minor updates
jquery.inview.coffee Add Travis CI config & minor updates
jquery.inview.js Add Travis CI config & minor updates
jquery.inview.min.js Add Travis CI config & minor updates
package.json Add Travis CI config & minor updates

README.md

jQuery.inView Plugin(ish)

Build Status

This is a simple plugin I've thrown together for my blog/personal site, where I use it to defer the loading of Disqus comments. This script can be used to defer the loading of third party plugins, scripts, or anything else you want to do once elements have come into view.

The plugin uses jQuery's Deferred Object API.

Documentation

$.inView()

  • The $.inView() function, when called will return a new jQuery.Deferred object that will resolve once all elements in the jQuery object have come into view.

Usage Example

$.when($('#myElement').inView()).then(function($el){
  alert($el.attr('id') + ' is now in view');
});

Or

$('#myElement').inView(function(){
  alert($(this).attr('id') + ' is now in view');
});

Dependencies

Something went wrong with that request. Please try again.