1<script type= "Text/javascript" >2 lefttimeact ();3 //Project Countdown not started4 functionlefttimeact () {5 varLEFTTIMEACTINV =NULL;6 cleartimeout (LEFTTIMEACTINV);7$ (". Left_time"). each (function(){8 varLefttime = parseint ($ ( This). attr ("Data"));9 if(Lefttime > 0)Ten { One varDay = parseint (lefttime/24/3600); A varhour = parseint ((lefttime% (24 *3600))/3600); - varmin = parseint ((lefttime% 3600)/60); - varSEC = parseint ((lefttime% 3600)% 60); the$( This). Find (". Day"). HTML ((day<10? "). 0 "+day:day)); -$( This). Find (". Hour"). html ((hour<10? "). 0 "+hour:hour)); -$( This). Find (". Min"). html ((min<10? "). 0 "+min:min)); -$( This). Find (". SEC"). html ((sec<10? "). 0 "+sec:sec)); +lefttime--; -$( This). attr ("Data", lefttime); + } A Else{ at window.location.reload (); - return false; - } - }); -LEFTTIMEACTINV = SetTimeout (function(){ - lefttimeact (); in},1000); - } to</script>
1 <Divclass= "Left_time"Data= "{$deal _item_in.left_begin_day}">2 <emclass= "s Day">--</em>3 <emclass= "L">Days</em>4 <emclass= "s Hour">--</em>5 <emclass= "L">When</em>6 <emclass= "s min">--</em>7 <emclass= "L">Score of</em>8 <emclass= "s sec">--</em>9 <emclass= "L">Seconds</em>Ten </Div>
Multiple countdown on same page simultaneously