html部分
<span class="time_wrap" value="1397145180" style="line-height:200%;"></span>
js部分
<script type="text/javascript">
$(document).ready(function(){
setInterval(function(){
$(".time_wrap").each(function(){
var Obj = this;
var EndTime = new Date(parseInt($(Obj).attr('value')) * 1000);
var NowTime = new Date();
var nMS=EndTime.getTime() - NowTime.getTime();
var nD=Math.floor(nMS/(1000 * 60 * 60 * 24));
var nH=Math.floor(nMS/(1000*60*60)) % 24;
var nM=Math.floor(nMS/(1000*60)) % 60;
var nS=Math.floor(nMS/1000) % 60;
var nMS=Math.floor(nMS/100) % 10;
if(nD>= 0){
var str = '<span class="timer" ><em>'+nD+'</em>天<em>'+nH+'</em>小时<em>'+nM+'</em>分<em>'+nS+'.'+nMS+'</em>秒</span>';
$(Obj).html(str);
}
});
}, 100);
});
</script>