zoukankan      html  css  js  c++  java
  • 最简单明了的QQ在线客服代码

    最近老用来QQ在线客服代码,网上找的都不太顺手,自己写一个简单,只上下飘动。
    源码下载:网站被封了,源码下载不了,但是这个源码很简单,相信有点基础的人都知道怎样用。
    floatAd.js代码如下:
    var lastScrollY=0;//滚动条距顶部位置
    function heartBeat(){ 
        
    var diffY;
        
    if (document.documentElement && document.documentElement.scrollTop)
             diffY 
    = document.documentElement.scrollTop;
        
    else if (document.body)
             diffY 
    = document.body.scrollTop
        
    else
             {
    /*Netscape stuff*/}
        
        percent
    =.1*(diffY-lastScrollY); 
        
    if(percent>0)percent=Math.ceil(percent); 
        
    else percent=Math.floor(percent); 
        document.getElementById(
    "gvRightAd").style.top=parseInt(document.getElementById("gvRightAd").style.top)+percent+"px";

        lastScrollY
    =lastScrollY+percent; 
    }
    window.setInterval(
    "heartBeat()",100);//每0.1秒钟执行一次
    调用:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        
    <title>最简单明了的QQ在线客服代码</title>
        
    <script type="text/javascript" src="style/floatAd.js"></script>
    </head>
    <body style="height:1000px;">
    <div id="gvRightAd"  style='right:50px;POSITION:absolute;TOP:230px;text-align:center;117px;'>
        
    <table style="117px;" cellpadding="0" cellspacing="0">
            
    <tr>
                
    <td><img src="images/qq/qqbg1.gif" alt="" /></td>
            
    </tr>
            
    <tr>
                
    <td style="background:url(images/qq/qqbg2.gif) repeat-y;">
                    
    <div><!--这里的QQ代码请到http://imis.qq.com/webpresence/code.shtml申请-->
                    
    <href="http://sighttp.qq.com/cgi-bin/check?sigkey=7cd7c4f0fe8acae47af475bfd5864dd2a9910c5e16692240f96d1d9343fa6e82b8685b01340a0c99b5f625bc523faf6d34ae463cf21aba0e"; target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=7cd7c4f0fe8acae47af475bfd5864dd2a9910c5e16692240f96d1d9343fa6e82b8685b01340a0c99b5f625bc523faf6d34ae463cf21aba0e';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img border="0" SRC='http://wpa.qq.com/pa?p=1:1090126549:1' alt="张老师"></a>
                    
    </div>
                    
    <div><href="http://sighttp.qq.com/cgi-bin/check?sigkey=7cd7c4f0fe8acae4d6822fba4ae9ad0363e4805f0a646f849ad95f6a69ffc6c52caf5f5505cbbaa4d5666e4f402e1f9177da136fadfad826"; target=_blank; onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=7cd7c4f0fe8acae4d6822fba4ae9ad0363e4805f0a646f849ad95f6a69ffc6c52caf5f5505cbbaa4d5666e4f402e1f9177da136fadfad826';var oldscript=document.getElementById('testJs');var newscript=document.createElement('script');newscript.setAttribute('type','text/javascript'); newscript.setAttribute('id', 'testJs');newscript.setAttribute('src',tempSrc);if(oldscript == null){document.body.appendChild(newscript);}else{oldscript.parentNode.replaceChild(newscript, oldscript);}return false;"><img border="0" SRC='http://wpa.qq.com/pa?p=1:1131441761:1' alt="王老师"></a>
                    
    </div>
                
    </td>
            
    </tr>
            
    <tr>
                
    <td><img src="images/qq/qqbg3.gif" alt="" /></td>
            
    </tr>
        
    </table>
            
        
    </div>
    </body>
    </html>
  • 相关阅读:
    Autofac
    MYSQL存储过程获取记录总数
    MYSQL通用存储过程
    判断用户用手机访问还是用电脑访问网页
    HttpRuntime.Cache与HttpContext.Current.Cache
    Eclipse之NDK编译-- Type 'jint' could not be resolved, and JNIEnv, jclass错误解决办法
    解决Android adjustresize全屏无效问题
    Android手机使用广播监听手机收到的短信
    使用Jackson解析首字母大写的json字符串
    Android Studio中设置提示函数用法
  • 原文地址:https://www.cnblogs.com/greatverve/p/1514034.html
Copyright © 2011-2022 走看看