实例介绍:如何做一个浮动的QQ客服,还有在线MSN?而且能够随着浮动条上下移动

把下面的代码粘贴到网页的body范围内就可以了。
示范网址: http://www.lhsoft.com.cn/index.jsp

<!-- ********QQ在线咨询代码(浮动)开始******** -->
<script>
var online= new Array();
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>

<layer name="divStayTopLeft" left="880" top="1055" id="divStayTopLeft">

<table width="110" border="1">
    <tr>
      <td width="100" background="../images/title.JPG">QQ Online </td>
    </tr>
    <tr>
      <td><img src="../images/online.JPG" width="100" height="35"></td>
    </tr>
    <tr>
      <td height="207" bgcolor="#7BA2EF"><table width="93" border="0" align="center" bgcolor="#E7F3FF">
        <tr>
          <td width="126" align="center">销售咨询</td>
        </tr>
        <tr>
          <td align="center"><a target=blank href=tencent://message/?uin=37804333&Site=lhsoft.com.cn&Menu=yes><img border="0" src=http://wpa.qq.com/pa?p=1:37804333:6 alt="我是37804333,请问我有什么可以帮到您呢?"></a></td>
        </tr>
        <tr>
          <td align="center"><a target=blank href=tencent://message/?uin=807995337&Site=lhsoft.com.cn&Menu=no><img border="0" src=http://wpa.qq.com/pa?p=1:807995337:6 alt="我是807995337,请问我有什么可以帮到您呢?"></a></td>
        </tr>
         <tr>
          <td align="center"><a target=blank href=msnim:chat?contact=huangminghui2003@hotmail.com><img border="0" src="../images/msn.gif" alt="我是huangminghui2003@hotmail.com,请问我有什么可以帮到您呢?"></a></td>
        </tr>
        <tr>
          <td align="center">技术咨询</td>
        </tr>       
        <tr>
          <td align="center"><a target=blank href=tencent://message/?uin=19598123&Site=lhsoft.com.cn&Menu=yes><img border="0" src=http://wpa.qq.com/pa?p=1:19598123:6 alt="我是19598123,请问我有什么可以帮到您呢?"></a></td>
        </tr>
        <tr>
          <td align="center"><a target=blank href=tencent://message/?uin=247695564&Site=lhsoft.com.cn&Menu=yes><img border="0" src=http://wpa.qq.com/pa?p=1:247695564:6 alt="我是247695564,请问我有什么可以帮到您呢?"></a></td>
        </tr>
        <tr>
          <td align="center"><a target=blank href=msnim:chat?contact=szliszt@hotmail.com><img border="0" src="../images/msn.gif" alt="我是szliszt@hotmail.com,请问我有什么可以帮到您呢?"></a></td>
        </tr>
        <tr>
          <td align="center">远程客服</td>
        </tr>
        <tr>
          <td align="center"><a target=blank href=tencent://message/?uin=373285520&Site=lhsoft.com.cn&Menu=yes><img border="0" src=http://wpa.qq.com/pa?p=1:373285520:6 alt="我是373285520,请问我有什么可以帮到您呢?"></a></td>
        </tr>
      </table>      </td>
    </tr>
    <tr>
      <td height="30" background="../images/title.JPG">点击客户QQ号码及时交流或留言</td>
    </tr>
  </table>
 

</layer>
<script type="text/javascript">
//Enter "frombottom" or "fromtop"
var verticalpos="frombottom"
if (!document.layers)
document.write('</div>')

function JSFX_FloatTopDiv()
{
var startX =3,
startY = 500;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function()
{
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("divStayTopLeft");
stayTopLeft();
}
JSFX_FloatTopDiv();
</script>
<!-- ********浮动的QQ在线咨询代码结束******** -->
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值