特效描述:html5数字翻页时钟。html5获取本地时间带翻页效果的时钟代码。
代码结构
1. 引入JS
2. HTML代码
:
:
// set 3d transforms
TweenMax.set("#clock", {perspective:1500})
TweenMax.set(".upper", {rotationX:0.01, transformOrigin:"50% 100%"})
TweenMax.set(".lower", {rotationX:0.01, transformOrigin:"50% 0%"})
// set clock
var t, ss, mm, hh;
setTimeVars();
function setTimeVars(){
t = new Date();
t = new Date();
ss = String(t.getSeconds());
mm = String(t.getMinutes());
hh = String( (t.getHours()>12) ? t.getHours()-12 : t.getHours() );
if (ss.length==1) ss = "0"+ss;
if (mm.length==1) mm = "0"+mm;
if (hh.le