浏览器兼容问题,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> 展开
1个回答
微测检测5.10
2023-07-11 广告
2023-07-11 广告
IEC62133与en62133的区别如下:1. 认证机构不同:IEC62133是国际的标准,它以国际通用的标准进行生产;而en62133采用的是欧盟的标准,它使用欧盟的生产需求进行生产。2. 宗旨不同:IEC62133的宗旨是促进电气、电...
点击进入详情页
本回答由微测检测5.10提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询