I have clock,but it found on a book,it's working fine.But i need to convert it to normal analog clock.
setInterval(update, 1000);
function update() {
try {
// Get Date
var currentDate = new Date();
var hoursInPixel = currentDate.getHours() * (400/24) + "px";
var minutesInPixel = currentDate.getMinutes() * (400/60) + "px";
var secondsInPixel = currentDate.getSeconds() * (400/60) + "px";
// Update Hours
var hourBar = sym.$("hourBar");
hourBar.css( "width", hoursInPixel );
// Update Minutes
var minuteBar = sym.$("minuteBar");
minuteBar.css( "width", minutesInPixel );
// Update Seconds
var secondBar = sym.$("secondBar");
secondBar.css( "width", secondsInPixel );
// TEMP
console.log(window.focus, window.hasFocus, window.focus(), window.hasFocus());
} catch (error) {
console.log("Error: ", error);
}
}
(Only bars are updating,left side clock is just a picture)
I Just try to convert it to analog clock using codes but it's not working.I just try to change secondBar.css to rotate enable,but not working.I think my codes rae wrong,please help me.
Can any one give me correct code for this.please