$(document).ready( function (){ setInterval( function (){ var StartTimeText = new Date().getTime(); //当前时间 var djstime = $(".EndTimeText").html() * 1000 - StartTimeText; //结束时间减去当前时间 var hours = parseInt((djstime
$(document).ready(function(){ setInterval(function(){ var StartTimeText = new Date().getTime(); //当前时间 var djstime = $(".EndTimeText").html() * 1000 - StartTimeText; //结束时间减去当前时间 var hours = parseInt((djstime % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = parseInt((djstime % (1000 * 60 * 60)) / (1000 * 60)); var seconds = (djstime % (1000 * 60)) / 1000; hours = hours < 10 ? (‘0‘ + hours) : hours; minutes = minutes < 10 ? (‘0‘ + minutes) : minutes; seconds = seconds < 10 && seconds >= 1 ? (‘0‘ + seconds) : seconds; $(".TimeText").html(‘<bdi>‘ + hours + ‘</bdi>:<bdi>‘ + minutes + ‘</bdi>:<bdi>‘ + parseInt(seconds) + ‘</bdi>‘); },500); });