This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Document sizes are a browser compatibility nightmare because, although all browsers expose clientHeight and s | |
* crollHeight properties, they don't all agree how the values are calculated. | |
* @return {float} Height of the page after calulation. | |
* */ | |
function getDocumentHeight(){ | |
var body = document.body, | |
html = document.documentElement; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {Object} el Element where the event needed to be added | |
* @param {string} type Type of event which is getting added | |
* @param {function} handler Event handler which will get called. | |
*/ | |
function addHandler(el, type, handler) { | |
//overwrite the existing function | |
if (el.addEventListener){ //DOM2 Events | |
addHandler = function(el, type, handler) { | |
el.addEventListener(type, handler, false) |
OlderNewer