网页中实现浮动客服窗口

<LINK rel="stylesheet" type="text/css" href="http://www.amboedu.com/templets/style/leyuqq.css">
<div class="qqbox" id="divQQbox">
<div class="qqkfbt">
<a href='http://bjtts.web-81.com/' title="TTS" target="_blank"><img src="/v7sp/images/v7/leyubg1.gif" width="88" height="123" border=0>
</a>
</div>
<div class="lebg"  id="contentid">
    <div class="onqq"><div class="qqpic">
<a href="http://wpa.qq.com/msgrd?v=3&uin=471662634&site=qq&menu=yes";target=_blank; ><img border="0" SRC='http://wpa.qq.com/pa?p=2:471662634:44' alt="TTS1">
</a></div></div>
    <div style="clear:both;"></div>
    <div class="onqq"><div class="qqpic">
<a href="http://wpa.qq.com/msgrd?v=3&uin=1543250383&site=qq&menu=yes"; target=_blank; ><img border="0" SRC=' http://wpa.qq.com/pa?p=2:1543250383:44' alt="TTS2">
</a></div></div>
      <div style="clear:both;"></div>
    <div class="onqq"><div class="qqpic">
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=174339714&site=qq&menu=yes"><img border="0" src=" http://wpa.qq.com/pa?p=2:174339714:44" alt="点击这里给我发消息" title="点击这里给我发消息">
</a></div></div>
      <div style="clear:both;"></div>
    </div>
 <div class="qqfoot"><img src="http://www.amboedu.com/templets/style/img/leyubg3.gif" widht="88" height="12"></div> 
</div>
<script type="text/javascript">
var tips;
var theTop = 70;
var old = theTop;
function initFloatTips()
{
tips = document.getElementById('divQQbox');
moveTips();
}
function moveTips()
{
   var tt=50;
    if (window.innerHeight)
    {
   pos = window.pageYOffset
    }else if (document.documentElement && document.documentElement.scrollTop) {
   pos = document.documentElement.scrollTop
    }else if (document.body) {
      pos = document.body.scrollTop;
    }
    //http:
    pos=pos-tips.offsetTop+theTop;
    pos=tips.offsetTop+pos/10;
    if (pos < theTop){
    pos = theTop;
    }
    if (pos != old) {
    tips.style.top = pos+"px";
    tt=10;//alert(tips.style.top);
    }
    old = pos;
    setTimeout(moveTips,tt);
}
initFloatTips();
if(typeof(HTMLElement)!="undefined")//给firefox定义contains()方法,ie下不起作用
   {
    HTMLElement.prototype.contains=function (obj)
    {
     while(obj!=null&&typeof(obj.tagName)!="undefind"){//
        if(obj==this) return true;
         obj=obj.parentNode;
         }
     return false;
    }
}
</script>
只需要把qq号码换成自己的就可以了!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值