Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

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

About

jQuery plugin to detect if something is in view or not.

Resources

Stars

Watchers

Forks

Packages

No packages published