php右侧弹窗QQ客服,JavaScript_网页右侧悬浮滚动在线qq客服代码示例,网页右侧悬浮滚动QQ在线客服 - phpStudy...
網(wǎng)頁右側(cè)懸浮滾動在線qq客服代碼示例
網(wǎng)頁右側(cè)懸浮滾動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 now=0;
var bStop=true;
for (var attr in json){
if(attr=='opacity'){
now=Math.round(parseFloat(getStyle(obj,attr))*100);
}else{
now=parseInt(getStyle(obj,attr));
};
var speed=(json[attr]-now)/5;
speed=speed>0?Math.ceil(speed):Math.floor(speed);
if(now!=json[attr])bStop=false;
if(attr=='opacity'){
obj.style.filter='alpha(opacity:'+now+speed+')';
obj.style.opacity=(now+speed)/100;
}else{
obj.style[attr]=speed+now+'px';
};
}
if(bStop){
clearInterval(obj.timer);
if(fnEnd)fnEnd();
}
}, 30);
}
function Flexing(obj,json,fnEnd){
clearInterval(obj.timer);
obj.timer=setInterval(function(){
var now=0;
var bStop=true;
for (var attr in json){
if(!obj.speed)obj.speed={};
if(!obj.speed[attr])obj.speed[attr]=0;
now=parseInt(getStyle(obj,attr));
if(Math.abs(json[attr]-now)>1 || Math.abs(obj.speed[attr])>1){
bStop=false;
obj.speed[attr]+=(json[attr]-now)/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]=now+obj.speed[attr]+'px';
};
};
if(bStop){
clearInterval(obj.timer);
obj.style[attr]=json[attr]+'px';
if(fnEnd)fnEnd();
};
}, 30);
}
function setqq(obj,num){
if (obj.length!=num.length){
alert('\nspan的個數(shù)與QQ號碼的個數(shù)不符,請設(shè)置5個QQ號碼!\n\n[設(shè)置未成功!]');
return;
}else{
for (var i=0; i
???obj[i].innerHTML = "";
};
};
};
function settop(id,id2,top){
var obj = document.getElementById(id);
var box = document.getElementById(id2);
obj.style.top = box.style.top = top+'px';
};
function dealy(id,time){
var obj = document.getElementById(id);
var timer = setTimeout(function(){
Flexing(obj,{right:-100});
},time*1000);
};
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);
};
};相關(guān)閱讀:
jQuery實現(xiàn)加入購物車飛入動畫效果
必須收藏的php實用代碼片段
臺式電腦升級安裝Win10正式版后沒有聲音的五種方法 堪稱史上最全的匯總
Bootstrap按鈕組件詳解
Javascript基礎(chǔ)教程之a(chǎn)rgument 詳解
深入領(lǐng)悟JavaScript中的面向?qū)ο?/p>
Java中實現(xiàn)雙數(shù)組Trie樹實例
php錯誤日志簡單配置方法
jQuery Easyui 驗證兩次密碼輸入是否相等
HTML5的標(biāo)簽的代碼的簡單介紹 HTML5標(biāo)簽的簡介
jquery.cookie.js用法實例詳解
關(guān)于PHP中Session文件過多的問題及session文件保存位置
Windows7系統(tǒng)下在局域網(wǎng)上隱藏計算機(jī)的設(shè)置方法
CSS3媒體查詢Media Queries基礎(chǔ)學(xué)習(xí)教程
總結(jié)
以上是生活随笔為你收集整理的php右侧弹窗QQ客服,JavaScript_网页右侧悬浮滚动在线qq客服代码示例,网页右侧悬浮滚动QQ在线客服 - phpStudy...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 盾眼ddos攻防态势(盾眼ddos地址防
- 下一篇: ddos费用(山东ddos续费)