The popular open-source contract for web designers and developers by Stuff & Nonsense
- Originally published: 23/12/2008
- Revised date: 15/12/2013
- Original post
.nav { | |
z-index: 2; | |
position: fixed; | |
top: 0; | |
right: 0; | |
transform: rotate(90deg) translate(100%,100%); | |
transform-origin: 100% 100%; | |
} |
var i = 0; | |
for( i; i <= 100; i++) { | |
var buffer = ''; | |
if ( i % 3 === 0) { | |
buffer = 'fizz'; | |
if ( i % 5 === 0) { | |
buffer += ' buzz'; |
//php print_r equalivalent | |
//http://scriptnode.com/article/javascript-print_r-or-var_dump-equivalent/ | |
function print_r(x, max, sep, l) { | |
l = l || 0; | |
max = max || 10; | |
sep = sep || ' '; | |
if (l > max) { | |
return "[WARNING: Too much recursion]\n"; |
<script> | |
// set a global version var for cache busting | |
var CITY_VERSION = "%globals_snippet_77381%."; | |
yepnope([ | |
{ | |
test: 'querySelector' in document && 'localStorage' in window && 'addEventListener' in window, | |
yep: { | |
"jQuery2" : '//ajax.aspnetcdn.com/ajax/jQuery/jquery-2.0.3.min.js' | |
}, |
// fallback for browsers that don't understand placeholder attribute | |
if (!Modernizr.input.placeholder) { | |
$("[placeholder]").focus(function() { | |
var input = $(this); | |
if (input.val() === input.attr("placeholder")) { | |
input.val(""); | |
input.removeClass("placeholder"); | |
} | |
}).blur(function() { |
/** | |
* Read a page's GET URL variables and return them as an associative array. | |
*/ | |
getUrlVars = function() { | |
var vars = [], | |
hash, | |
i = 0, | |
hashes = window.location.href.slice(window.location.href.indexOf("?") + 1).split("&"); |
/** | |
* returns true if a number is even | |
* @param {Number} value | |
* @return {Boolean} | |
*/ | |
isEven = function(value) { | |
if (value % 2 === 0) { | |
return true; | |
} else { |
waitForFinalEvent = (function () { | |
var timers = {}; | |
return function (callback, ms, uniqueId) { | |
if (!uniqueId) { | |
uniqueId = "Don't call this twice without a uniqueId"; | |
} | |
if (timers[uniqueId]) { | |
clearTimeout (timers[uniqueId]); | |
} | |
timers[uniqueId] = setTimeout(callback, ms); |