This file contains 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
function getClientHeight(){ | |
return (document.documentElement.clientHeight || window.innerHeight || document.body.clientHeight); | |
} | |
function getScrollTop(){ | |
return document.getElementsByTagName('html')[0].scrollTop; | |
} | |
function getLazyLoadScroll(){ | |
return window._config.lazyload_scroll_px || 500; | |
} |
This file contains 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
<html> | |
<body> | |
<div id="example"></div> | |
<script type="text/javascript"> | |
var x=navigator.plugins.length; // store the total no of plugin stored | |
var txt="Total plugin installed: "+x+"<br/>"; | |
txt+="Available plugins are->"+"<br/>"; | |
for(var i=0;i<x;i++) | |
{ | |
txt+=navigator.plugins[i].name + "<br/>"; |
This file contains 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
/* | |
REM vs PX Based off of this | |
http://snook.ca/archives/html_and_css/font-size-with-rem | |
*/ | |
/* IMPORTANT: Don't ever change this */ | |
@broswerfontsize : 16; | |
/* CHANGE: THIS IS THE BASE FONT SIZE AND SHOULD BE SET ONLY ONCE */ |
This file contains 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
var page = require('webpage').create(), | |
t, address; | |
if (phantom.args.length === 0) { | |
console.log('Usage: findlink.js <some URL>'); | |
phantom.exit(); | |
} else { | |
t = Date.now(); | |
address = phantom.args[0]; | |
page.open(address, function (status) { |
This file contains 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
function addEvent(target, type, handler) { | |
if (target.addEventListener){ | |
target.addEventListener(type, handler, false); | |
}else{ | |
target.attachEvent("on" + type, | |
function(event) { | |
// Invoke the handler as a method of target, | |
// passing on the event object | |
return handler.call(target, event); | |
}); |
This file contains 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
//modify this as needed just a reminder of how to do it | |
function SelectAll(id) | |
{ | |
document.getElementById(id).focus(); | |
document.getElementById(id).select(); | |
} |
This file contains 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
//this needs to go somewhere | |
var modules = {}; | |
modules.ajax = function(){ | |
var args = Array.prototype.slice.call(arguments), createXMLHTTPObject = function(){ | |
var xmlhttp, XMLHttpFactories = [ | |
function() { return new XMLHttpRequest(); } | |
,function() { return new ActiveXObject('Msxml2.XMLHTTP.6.0'); } | |
,function() { return new ActiveXObject('Msxml2.XMLHTTP.3.0'); } | |
,function() { return new ActiveXObject('Msxml2.XMLHTTP'); } | |
,function() { return new ActiveXObject('Msxml3.XMLHTTP'); } |
This file contains 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
/* | |
http://css-tricks.com/snippets/css/clear-fix/ | |
*/ | |
.group:before, | |
.group:after { | |
content:""; | |
display:table; | |
} | |
.group:after { | |
clear:both; |
This file contains 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
Object.deepExtend = function(destination, source) { | |
for (var property in source) { | |
if (source[property] && source[property].constructor && | |
source[property].constructor === Object) { | |
destination[property] = destination[property] || {}; | |
arguments.callee(destination[property], source[property]); | |
} else { | |
destination[property] = source[property]; | |
} | |
} |
NewerOlder