浏览器兼容问题,js倒计时在IE上显示不出来
倒计时在ie浏览器上显示不出来,在谷歌可以显示,代码如下<SCRIPTtype="text/javascript">(function($){$(function(){c...
倒计时在ie浏览器上显示不出来,在谷歌可以显示,代码如下
<SCRIPT type="text/javascript">(function ($) {
$(function () {
countDown("2016-06-30 00:00:00", "#djsTime6");
//倒计时
function countDown(time, djsTime) {
//if(typeof end_time == "string")
var end_time = new Date(time).getTime(),//月份是实际月份-1
//current_time = new Date().getTime(),
sys_second = (end_time - new Date().getTime()) / 1000;
var timer = setInterval(function () {
if (sys_second > 0) {
sys_second -= 1;
var day = Math.floor((sys_second / 3600) / 24)+"天";
var hour = Math.floor((sys_second / 3600) % 24);
var minute = Math.floor((sys_second / 60) % 60);
var second = Math.floor(sys_second % 60);
var hourText = (hour < 10 ? "0" + hour : hour)+"时";
var minuteText = (minute < 10 ? "0" + minute : minute)+"分";
var secondText = (second < 10 ? "0" + second : second)+"秒";
$(djsTime).text(day+hourText+minuteText+secondText);
} else {
clearInterval(timer);
}
}, 1000);
}
});
})(jQuery);
</SCRIPT> 展开
<SCRIPT type="text/javascript">(function ($) {
$(function () {
countDown("2016-06-30 00:00:00", "#djsTime6");
//倒计时
function countDown(time, djsTime) {
//if(typeof end_time == "string")
var end_time = new Date(time).getTime(),//月份是实际月份-1
//current_time = new Date().getTime(),
sys_second = (end_time - new Date().getTime()) / 1000;
var timer = setInterval(function () {
if (sys_second > 0) {
sys_second -= 1;
var day = Math.floor((sys_second / 3600) / 24)+"天";
var hour = Math.floor((sys_second / 3600) % 24);
var minute = Math.floor((sys_second / 60) % 60);
var second = Math.floor(sys_second % 60);
var hourText = (hour < 10 ? "0" + hour : hour)+"时";
var minuteText = (minute < 10 ? "0" + minute : minute)+"分";
var secondText = (second < 10 ? "0" + second : second)+"秒";
$(djsTime).text(day+hourText+minuteText+secondText);
} else {
clearInterval(timer);
}
}, 1000);
}
});
})(jQuery);
</SCRIPT> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询