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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 zAddMulilineEllipsis(el,container,maxHeight){ | |
var tag,tagHeight,tagContentHeight; | |
tag=el; | |
tagContentHeight=tag.scrollHeight; | |
if(maxHeight===undefined){tagHeight=tag.offsetHeight;}else{tagHeight=maxHeight;} | |
if(tagContentHeight>tagHeight){ | |
if(container=='parent'){zAddClass(tag.parentNode,'applyEllipsis');} | |
else if(container=='self'){zAddClass(tag,'applyEllipsis');} | |
} | |
} |
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
<body ontouchstart=""> |
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 isAndroid(){ | |
return navigator.userAgent.toLowerCase().indexOf("android") > -1; | |
} | |
isAndroid(); | |
function isIOS(){ | |
return navigator.userAgent.match(/(iPad|iPhone|iPod)/i) != null; | |
} | |
isIOS(); |
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
window.onerror = function(a,b,c) { | |
alert(a + "; " + b + "; " + c); | |
} |
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
.productSubNavContainer{ | |
height:44px; | |
box-shadow:inset 0 1px 0 0 rgba(0,0,0,0.1); | |
background-color:#D6D9DC; | |
} | |
.productSubNav{ | |
&.fixed{ | |
@include z-position(fixed,0px,0px,0,0px); | |
box-shadow:inset 0 1px 0 0 rgba(0,0,0,0.1); | |
background-color:#D6D9DC; |
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
//requires helpers.js | |
function showDialog(dialogToShow,event){ | |
event.preventDefault ? event.preventDefault():event.returnValue=false; | |
zAddClass(zQ('body'),'overflowHidden'); | |
zAddClass(zQ('.backdrop'),'displayBlock'); | |
zAddClass(zQ('.dialog'),'displayBlock'); | |
} | |
function hideDialog(event){ | |
event.preventDefault ? event.preventDefault():event.returnValue=false; | |
zRemoveClass(zQ('body'),'overflowHidden'); |
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
.fluidVidContainer{width:100%;position:relative;margin-bottom:20px} | |
.fluidVidContainer:before{ | |
display:block;content:''; | |
padding-top:56.25%;/*16x9*/ | |
padding-top:75%;/*4x3*/ | |
padding-top:200%;/*1x2*/ | |
padding-top:50%;/*2x1*/ | |
padding-top:100%;/*1x1*/ | |
} | |
.fluidVidContainer iframe{position:absolute;top:0;left:0;width:100%;height:100%} |
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 getPhoneGapPath() { | |
var path = window.location.pathname; | |
path = path.substr( path, path.length - 10 ); | |
return 'file://' + path; | |
} | |
var snd = new Media( getPhoneGapPath() + 'test.wav' ); |
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
/* Pre-Define HTML5 Elements in IE */ | |
(function(){ var els = "source|address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|main|mark|meter|menu|nav|picture|progress|ruby|section|time|video".split('|'); for(var i = 0; i < els.length; i++) { document.createElement(els[i]); } } )(); |
OlderNewer