Jump to content

User:MindstormsKid/vector.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
MindstormsKid (talk | contribs)
m add zeros
MindstormsKid (talk | contribs)
m prepend
Line 3: Line 3:
// clock!
// clock!
addOnloadHook(function(){
addOnloadHook(function(){
jQuery("#p-personal ul").append('<li id="pt-time">');
jQuery("#p-personal ul").prepend('<li id="pt-time">');


setInterval(function(){
setInterval(function(){

Revision as of 05:07, 29 August 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("#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; }
});