User:MindstormsKid/vector.js: Difference between revisions
Appearance
Content deleted Content added
m prepend |
m fix |
||
Line 3: | Line 3: | ||
// clock! |
// clock! |
||
addOnloadHook(function(){ |
addOnloadHook(function(){ |
||
jQuery.noConflict(); |
|||
jQuery("#p-personal ul").prepend('<li id="pt-time">'); |
jQuery("#p-personal ul").prepend('<li id="pt-time">'); |
||
Line 9: | Line 11: | ||
jQuery("#pt-time").html(addzero(date.getUTCHours()) + ":" + addzero(date.getUTCMinutes()) + ":" + addzero(date.getUTCSeconds())); |
jQuery("#pt-time").html(addzero(date.getUTCHours()) + ":" + addzero(date.getUTCMinutes()) + ":" + addzero(date.getUTCSeconds())); |
||
}, 1000); |
}, 1000); |
||
function addzero(n) { return (n < 10 ? "0" : "") + n; } |
function addzero(n) { return (n < 10 ? "0" : "") + n; } |
||
}); |
}); |
Revision as of 04:06, 1 September 2009
document.write('<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>');
// clock!
addOnloadHook(function(){
jQuery.noConflict();
jQuery("#p-personal ul").prepend('<li id="pt-time">');
setInterval(function(){
var date = new Date();
jQuery("#pt-time").html(addzero(date.getUTCHours()) + ":" + addzero(date.getUTCMinutes()) + ":" + addzero(date.getUTCSeconds()));
}, 1000);
function addzero(n) { return (n < 10 ? "0" : "") + n; }
});