网页右侧悬浮滚动在线qq客服代码示例
网页右侧悬浮滚动QQ在线客服代码
复制代码 代码如下:
function myEvent(obj,ev,fn){
if (obj.attachEvent){
obj.attachEvent('on'+ev,fn);
}else{
obj.addEventListener(ev,fn,false);
};
};
function getbyClass(id,sClass){
var oParent = document.getElementById(id);
var all = oParent.getElementsByTagName('');
var array = [];
for (var i=0; i if (all[i].className == sClass){
array.push(all[i]);
};
};
return array;
};
function getStyle(obj,name){
if(obj.currentStyle){
return obj.currentStyle[name];
}else{
return getComputedStyle(obj,false)[name];
};
};
function Running(obj,json,fnEnd){
clearInterval(obj.timer);
obj.timer=setInterval(function(){
var no=0;
var bS=true;
for (var attr in json){
if(attr=='opacity'){
no=Math.round(parseFloat(getStyle(obj,attr))100);
}else{
no=parseInt(getStyle(obj,attr));
};
var speed=(json[attr]-no)/5;
speed=speed>0?Math.ceil(speed):Math.floor(speed);
if(no!=json[attr])bS=false;
if(attr=='opacity'){
obj.style.filter='alpha(opacity:'+no+speed+')';
obj.style.opacity=(no+speed)/100;
}else{
obj.style[attr]=speed+no+'px';
};
}
if(bS){
clearInterval(obj.timer);
if(fnEnd)fnEnd();
}
}, 30);
}
function Flexing(obj,json,fnEnd){
clearInterval(obj.timer);
obj.timer=setInterval(function(){
var no=0;
var bS=true;
for (var attr in json){
if(!obj.speed)obj.speed={};
if(!obj.speed[attr])obj.speed[attr]=0;
no=parseInt(getStyle(obj,attr));
if(Math.abs(json[attr]-no)>1 || Math.abs(obj.speed[attr])>1){
bS=false;
obj.speed[attr]+=(json[attr]-no)/5;
obj.speed[attr]=0.85;
var MaxSpeed=65;
if(Math.abs(obj.speed[attr])>MaxSpeed){
obj.speed[attr]=obj.speed[attr]>0?MaxSpeed:-MaxSpeed;
};
obj.style[attr]=no+obj.speed[attr]+'px';
};
};
if(bS){
clearInterval(obj.timer);
obj.style[attr]=json[attr]+'px';
if(fnEnd)fnEnd();
};
}, 30);
}
function setqq(obj,num){
if (obj.length!=num.length){
alert('nspan的个数与QQ号码的个数不符,请设置5个QQ号码!nn[设置未成功!]');
return;
}else{
for (var i=0; i
};
};
};
function set(id,id2,){
var obj = document.getElementById(id);
var box = document.getElementById(id2);
obj.style. = box.style. = +'px';
};
function dealy(id,time){
var obj = document.getElementById(id);
var timer = setTimeout(function(){
Flexing(obj,{right:-100});
},time1000);
};
function click_fn(id,id2){
var obj = document.getElementById(id);
var box = document.getElementById(id2);
obj.onclick = function(){
Running(obj,{right:-200},function(){
box.style.display = 'block';
Running(box,{right:10, opacity:100});
});
};
box.onclick = function(){
timer = setTimeout(function(){
Running(box,{right:-220,opacity:0},function(){
box.style.display = 'none';
Flexing(obj,{right:-100});
});
},3000);
};
};
空调维修
- 温岭冰箱全国统一服务热线-全国统一人工【7X2
- 荆州速热热水器维修(荆州热水器维修)
- 昆山热水器故障码5ER-昆山热水器故障码26
- 温岭洗衣机24小时服务电话—(7X24小时)登记报
- 统帅热水器售后维修服务电话—— (7X24小时)登
- 阳江中央空调统一电话热线-阳江空调官方售后电
- 乌鲁木齐阳春燃气灶厂家服务热线
- 珠海许昌集成灶售后服务电话-全国统一人工【
- 乌鲁木齐中央空调维修服务专线-乌鲁木齐中央空
- 新沂热水器故障电话码维修-新沂热水器常见故障
- 诸城壁挂炉24小时服务热线电话
- 靖江空调24小时服务电话-——售后维修中心电话
- 空调室外滴水管维修(空调室外排水管维修)
- 九江壁挂炉400全国服务电话-(7X24小时)登记报修
- 热水器故障码f.22怎么解决-热水器f0故障解决方法
- 营口热水器售后维修服务电话—— 全国统一人工