获取样式:
var getStyle=function(ele,atr){
return typeof(ele)=='undefined'?0: ele.currentStyle? ele.currentStyle[atr] : window.getComputedStyle(ele, null)[atr];
}
时分秒倒计时://使用方法countDown(times,cb),times时间戳,cb,每秒执行的回调,输出,时分秒剩余
function countDown(times,cb) {
var timer = null;
times=times/1000;
timer = setInterval(function() {
var day = 0,
hour = 0,
minute = 0,
second = 0; //时间默认值
if (times > 0) {
// day = Math.floor(times / (60 * 60 * 24));
hour = Math.floor(times / (60 * 60));
minute = Math.floor(times / 60%60);
second = Math.floor(times)%60;
}
// if (hour <= 9) hour = '0' + hour;
if (minute <= 9) minute = '0' + minute;
if (second <= 9) second = '0' + second;
//><span class="paizi"><%=list.diffdays%></span><span class="maohao">天</span>
cb&&cb(hour,minute,second)
// console.log(day + "天:" + hour + "小时:" + minute + "分钟:" + second + "秒");
times--;
}, 1000);
if (times <= 0) {
clearInterval(timer);
}
}
微信内打开QQ聊天:
<a id='sendqq'></a>
其它移动端浏览器中打开QQ聊天:
<a id='sendqq'></a>
//移动端浏览器打开
PC端打开QQ聊天:
<a data-v-562a4e36="" href="tencent://message/?uin=*******&Site=Sambow&Menu=yes"></a>//您的QQ号替换星号
微信浏览器判断方法: