Skip to content
/ inView Public

A library that tells if an HTML element is in view or not.

Notifications You must be signed in to change notification settings

arpo/inView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

inView

A library that tells if an HTML element is in view or not. Requires jQuery.

// This fires when inView is checked.
// inView is checked when the browser is scrolling or resizing
// or MOS.inView.check(); is called.
$(document).on('MOS.inViewCheck', function(e) {
	console.log(e.states); //Returns an object with arrays of jQuery objects, split into visible, not visible elements and close to visible.
});

//Debug trace ON.
MOS.inView.doTrace = true;

// To check for elemnts ouside of the viewport you can increas outOfBoundsSize. Default is 1. 2 is 100% extra to the view port
MOS.inView.outOfBoundsSize = 2;

//Add item to check
MOS.inView.add($('.item'));

//Run check
MOS.inView.check();

##License License http://opensource.org/licenses/MIT

Copyright (c) Mattias Johansson 2016

About

A library that tells if an HTML element is in view or not.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published