/ Published in: JavaScript
http://developer.apple.com/jp/documentation/AppleApplications/Conceptual/Dashboard_Tutorial/index.html?http://developer.apple.com/jp/documentation/AppleApplications/Conceptual/Dashboard_Tutorial/Events/chapter_6_section_3.html
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if (window.widget) { widget.onshow = onshow; widget.onhide = onhide; } function onshow () { if (timer == null) { updateTime(); timer = setInterval("updateTime();", 1000); } } function onhide () { if (timer != null) { clearInterval(timer); timer = null; } }