Skip to content
jQuery plugin to detect if something is in view or not.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.project
README.md
bower.json
inView.js
inView.min.js

README.md

inView

lightweight jQuery plugin to detect if something is in view or not. minified is ~241 bytes.

usage :

  • requires jQuery
  • include/require after jQuery
  • attatch to elements on whatever event with optional padding
    • *padding is for when something is to be considered in-view
    • defaults to 1 window height.
  • returns boolean
  • i.e. $(window).on('scroll', function(){ if($('.element').inView(0)) { ... do something ... }});
  • note: onscroll runs a lot - probably better to setInterval and whatnot on scroll - maybe use my endedEvents utility
You can’t perform that action at this time.