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 { | |
font-size: 62.5%; | |
} | |
h1 { | |
font-size: 2em; | |
} | |
h2 { | |
font-size: 1.8em; | |
} | |
h3 { |
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
input, textarea, select { | |
font-size: 1.2em; | |
} |
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
h1 span { | |
font-size: 1.6em; /* useful if the mark-up is normal size different size */ | |
} |
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
#welcomeMessage p { | |
font-size: 1.5em; | |
} |
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 down = "mousedown", up = "mouseup"; | |
if("createTouch" in document) { | |
down = "touchstart", up = "touchend"; | |
} | |
el.addEventListener(down, func, false); | |
el.addEventListener(up, func, false); |
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 testEl = document.getElementById("el"); | |
testEl.onmousedown = function () { | |
// initialize mouse interface | |
} | |
testEl.ontouchstart = function () { | |
testEl.onmousedown = null; // initialize touch interface | |
} |
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 obj = (function() { | |
if(...) { | |
return function() { | |
//... | |
} | |
} | |
else { | |
return function() { | |
//... | |
} |
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 A = function() {} | |
var B = function() {} | |
// factory | |
var Type = function(name) { | |
if(name === "a") { | |
return new A(); | |
} | |
else { | |
return new B(); |
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 Field = function() { | |
this.validate = function() { | |
// ... | |
} | |
} | |
// the form holds many fields but they both have the same named public method "validate" | |
var FormValidator = function() { | |
var fields = []; | |
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 flashvars = {htmlSrc: encodeURIComponent(""+document.getElementById("containerId").innerHTML +"")}; | |
swfobject.embedSWF(..., flashvars, ...); |
OlderNewer