For any bloggers among you here is a simple countdown until we can get Labour out thingy.
In <head> section:-
script language=Javascript>
<!--
window.onload = init;
function init()
{
setInterval("election()",1000);
}
function election()
{
var today = new Date();
var sec = Math.floor((Date.parse("Jun 03, 2010")-today)/1000);
var min = Math.floor(sec/60); sec = sec - 60*min;
var hr = Math.floor(min/60); min = min - 60*hr;
var dy = Math.floor(hr/24); hr = hr - 24*dy;
document.getElementById("howlong").innerHTML=dy + " days, " + hr + " hours, " + min + " minutes, " + sec + " seconds";
}
//-->
</script>
In body text somewhere:-
<p>Time until we can get shot of the New Labour bastards:<br>
<span id="howlong" style="font-size:15px; color:red; text-align:center;">Too long</span></p>
PS document.getElementById bit is all one line
In <head> section:-
script language=Javascript>
<!--
window.onload = init;
function init()
{
setInterval("election()",1000);
}
function election()
{
var today = new Date();
var sec = Math.floor((Date.parse("Jun 03, 2010")-today)/1000);
var min = Math.floor(sec/60); sec = sec - 60*min;
var hr = Math.floor(min/60); min = min - 60*hr;
var dy = Math.floor(hr/24); hr = hr - 24*dy;
document.getElementById("howlong").innerHTML=dy + " days, " + hr + " hours, " + min + " minutes, " + sec + " seconds";
}
//-->
</script>
In body text somewhere:-
<p>Time until we can get shot of the New Labour bastards:<br>
<span id="howlong" style="font-size:15px; color:red; text-align:center;">Too long</span></p>
PS document.getElementById bit is all one line
Comment