Skip to content

Instantly share code, notes, and snippets.

View nhtua's full-sized avatar
👨‍✈️
looking for a co-pilot

Tua Nguyen nhtua

👨‍✈️
looking for a co-pilot
View GitHub Profile
@nhtua
nhtua / elementary.js
Last active November 27, 2015 04:38
[javascript] The common functions for js
/**
* This function check an element is scrolled into view area on screen.
* @param elem; use CSS Selector syntax to specific an element.
* @return boolean;
* @author Scott Dowding
* @refer http://stackoverflow.com/questions/487073
*/
function isScrolledIntoView(elem)
{
var $elem = $(elem);