View styles.css
.parent { | |
overflow: hidden; | |
position: relative; | |
width: 100%; | |
} | |
.child { | |
height: 100%; | |
position: absolute; | |
right: 0; |
View fibonacci.js
/** | |
* JavaScript function to output first 40 Fibonacci and convergence to Pi | |
*/ | |
for (var p = 1, q = 1, t, i = 1; i < 41; i++) { | |
console.log('Fibonacci[%d] (%d + %d): %d; Pi: %f', i, p, q, q, (q/p)); | |
t = q; | |
q = p + q; | |
p = t; | |
} |
View script.js
/** | |
* Set the URL hash in the format '#debug-ddmmyyyy' to set a global | |
* variable __DEBUG__ so that it can be used across all scritps to | |
* do console outputs, legacy alerts, etc. | |
*/ | |
var __DEBUG__ = (function() { | |
var pad = function (s) {return (s.length == 1 ? '0' + s : s)}, // to pad numbers with leading 0s | |
t = new Date(), | |
y = t.getFullYear().toString(), | |
m = pad((t.getMonth() + 1).toString()), // month is index returned in JS :) |
View styles.css
/** | |
* IE5.x | |
*/ | |
property/**/:/**/value; | |
/** | |
* IE6 and below | |
*/ | |
_property: value; | |
-property: value; |
View script.js
var global = window; // window for browser environments | |
for (var prop in global) { | |
if (Object.prototype.toString.call(global[prop]) === '[object Array]') { // check for array | |
if (prop !== 'undefined') { | |
console.log(prop); | |
} | |
} | |
} |