<marquee behavior="normal" direction="left">
<marquee> is a big no-no in web design
Use a boolean value, or even just check whether leaves is 0.Dear gods! You're raping switch!This will never be reached -- the browser will be directed to either shuttle.html or index.html, but either way it happens before this.
Factor in all of the above, and you can write that hideously huge switch statement in two lines:
Code:
var leaves = (function(x) { var v = x % 5; return (v === 0 ? 0 : 5) - v; })((new Date()).getMinutes());
window.location.href = (leaves === 0 ? "shuttle.html" : "index.html");
If you want to write that time rather than redirect to index.html, you can:
Code:
var leaves = (function(x) { var v = x % 5; return (v === 0 ? 0 : 5) - v; })((new Date()).getMinutes());
if(leaves === 0)
window.location.href = "shuttle.html";
else
document.write("in " + leaves + " minute" + (leaves === 1 ? "" : "s"));
Bookmarks