new Timer
                               etai


var aTimer = Ju.app.timer.create(
    {
        timeEnd: timeEnd,
        timeCurrent: timeCurrent,
        container: theTimer,
        style: 'simple',
        callback: function(handler){
                console.log(handler);

         }
     }
);
‣

‣

‣

‣

‣

‣
WTF?




   ....
1.

     •   ;
     •
setInterval : 5mins / hour
setTimeout : 10min / hour


                    10+ / day
2.

     •
3.

     •
     •
3.

     •
     •
-


a.


b.
-


a.


b.
-

b.
-
before:
-


a.       innerHTML
-


b. replaceHTML




                     When innerHTML isn’t Fast Enough
-


before       innerHTML   replaceHTML

ff3.6 2600   ff3.6 600   ff3.6 3000
ie8 6100     ie8 900     ie8   4200
ie6 6300     ie6 1200    ie6   5500
-



<p class="dsec">.6</p>
-



dsec.gif
-

html
-    “     ”

var aTimer = Ju.app.timer.create(
    {
        timeEnd: timeEnd,
        timeCurrent: timeCurrent,
        timeLeft: 0,
        container: theTimer,
        callback: function(handler){
            alert(‘time’s up!’);

         }
     }
);

Ju.app.timer.remove(aTimer);
-   “   ”
-   “   ”
-   “   ”
/ Tips
/ Tips - 1.             vs timer


•                   timer
•

•                 setInterval?
/ Tips - 1.       vs timer
“           ”




                  “    ”
/ Tips - 1.   vs timer
/ Tips - 1.   vs timer
/ Tips - 1.        vs timer


              =>
+
/ Tips
- 2. setTimeout vs setInterval
         “   bug”
/ Tips
- 2. setTimeout vs setInterval

    setTimeout
    or
    setInterval?
/ Tips 2. setTimeout vs setInterval




                  How JavaScript Timers Work
/ Tips
     - 2. setTimeout vs setInterval


SetTimeout
Google I/O Conference: HTML5 Countdown Finale
Google I/O Conference: HTML5 Countdown Finale
checker

          “   ”
Q /A
倒计时优化点滴

倒计时优化点滴