<div class="codetitle"> <span><a style="CURSOR: pointer" data="3661" class="copybut" id="copybut3661" onclick="doCopy('code3661')"><u>复制代码</u></a></span>如下代码:</div> <div class="codebody" id="code3661"> <br>(function(){ <br>QQMenuInt=_QQMenuInt; <br> moveQQmenu=_moveQQmenu; <br>function _QQMenuInt(){ <br>QQMenu.style.position="absolute"; <br>QQMenu.style.display=""; <br>if(parseInt(document.documentElement.offsetWidth) >1024){ <br>QQMenuPosition.Left =(parseInt(document.documentElement.offsetWidth)-1024-20); <br>} <br>if(QQMenuPosition.isRight){ <br>QQMenu.style.right= QQMenuPosition.Left "px"; <br>}else{ <br>QQMenu.style.left=QQMenuPosition.Left "px"; <br>QQMenu.style.top=QQMenuPosition.Top "px" <br>moveQQmenu(); <br>} <br>function _moveQQmenu(){ <br>var from=parseInt(QQMenu.style.top,10); <br>var yOffset <br>var to=window.pageYOffset; ?window.pageYOffset:document.documentElement.scrollTop; <br>to=to QQMenuPosition.Top; <br>if(to!=from){ <br>yOffset = Math.ceil(Math.abs(to-from)/ 20); <br>if(to<from>var oldTop=parseInt(QQMenu.style.top,10); <br>QQMenu.style.top=(oldTop yOffset) "px" ; <br>} <br>if(QQMenu.style.display!="none"){ <br>window.setTimeout("moveQQmenu()",QQMenuPosition.timeout); <br>} <br>} <br>})() <br><br></from> </div> <br><br>使用方法:<strong> </strong>1、引入上面的js <br>2、在页面的最后面加上<br><br><br><div class="codetitle"><span><a style="CURSOR: pointer" data="81635" class="copybut" id="copybut81635" onclick="doCopy('code81635')">复制代码<u></u></a>代码如下:</span></div> <div class="codebody" id="code81635"> <br>var QQMenuPosition={Left:10,Top:200,isRight:false,timeout:10} <br>var QQMenu=document.getElementById("QQMenu"); <br>QQMenuInt(); <br>脚本> <br><br><br><br>QQMenu为漂浮层的最外层ID <br>QQMenuPosition是设置漂浮层相关参数 <br>Left:层相对于左侧的偏移量。如果isRight为true则是相对于右侧的偏移量 <br>Top:层相对于顶部的偏移量 <br>timeout:层移动时间间隔,越大越慢<br><div class="htmlarea"> <textarea id="runcode11947"> <title>Untitled</title> <style type="text/css"> /*QQ在线客服务处*/ .kefuchu{ width:109px;} .SS_dh1{background:url(http://img.jb51.net/online/qq/images/SSindex/SS_dh1.jpg) no-repeat; height:51px; width:84px; float:left} .SS_dh2{background:url(http://img.jb51.net/online/qq/images/SSindex/SS_dh2.jpg) no-repeat; height:51px; width:25px; float:left; display:block} .SS_dh3{background:url(http://img.jb51.net/online/qq/images/SSindex/SS_dh3.jpg) repeat-y; width:109px; } .SS_dh4{background:url(http://img.jb51.net/online/qq/images/SSindex/SS_dh4.jpg) no-repeat; height:17px; width:109px; } .SS_dh5{background:url(http://img.jb51.net/online/qq/images/SSindex/SS_dh5.jpg) no-repeat; height:23px; width:74px; margin-left:20px;} </style> <!--QQ在线客服务处--> fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf fsdafsdfsfsdf <div class="kefuchu" id="QQMenu" style="display:none;"> <div class="SS_dh1"> </div> <a class="SS_dh2" href="javascript:void(0)" onclick="QQMenu.style.display='none'"> </a><span class="clear"> </span><div class="SS_dh3"> <div class="SS_dh5"> <a href="http://sighttp.qq.com/cgi-bin/check?sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc" target="_blank;" onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime=' Math.random() '&sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc';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:461478385:1" alt="可浮动QQ在线客服_javascript技巧"></a> </div> <script type="text/javascript" src="http://img.jb51.net/online/qq/js/QQMenu.js"></script><span class="clear"></span> <span class="blank8"></span> <div class="SS_dh5"><a href="http://sighttp.qq.com/cgi-bin/check?sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc" target="_blank;" onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime=' Math.random() '&sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc';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:461478385:1" alt="可浮动QQ在线客服_javascript技巧"></a></div> <span class="clear"></span> <span class="blank8"></span> <div class="SS_dh5"><a href="http://sighttp.qq.com/cgi-bin/check?sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc" target="_blank;" onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime=' Math.random() '&sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc';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:461478385:1" alt="可浮动QQ在线客服_javascript技巧"></a></div> <span class="clear"></span> <span class="blank8"></span> <div class="SS_dh5"><a href="http://sighttp.qq.com/cgi-bin/check?sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc" target="_blank;" onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime=' Math.random() '&sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc';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:461478385:1" alt="可浮动QQ在线客服_javascript技巧"></a></div> <span class="clear"></span> <span class="blank8"></span> <div class="SS_dh5"><a href="http://sighttp.qq.com/cgi-bin/check?sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc" target="_blank;" onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime=' Math.random() '&sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc';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:461478385:1" alt="可浮动QQ在线客服_javascript技巧"></a></div> <span class="clear"></span> <span class="blank8"></span> <div class="SS_dh5"><a href="http://sighttp.qq.com/cgi-bin/check?sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc" target="_blank;" onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime=' Math.random() '&sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc';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:461478385:1" alt="可浮动QQ在线客服_javascript技巧"></a></div> <span class="clear"></span> <span class="blank8"></span> <div class="SS_dh5"><a href="http://sighttp.qq.com/cgi-bin/check?sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc" target="_blank;" onclick="var tempSrc='http://sighttp.qq.com/wpa.js?rantime='+Math.random()+'&sigkey=d7bb49730f3ed47c475611fe4baa06914c1c954e4674e29bc09d96892eae6edc';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:461478385:1" alt="可浮动QQ在线客服_javascript技巧"></a></div> <span class="clear"></span> </div> <span class="clear"></span> <div class="SS_dh4"></div> </div> <script type="text/javascript"> var QQMenuPosition={Left:10,Top:200,isRight:false,timeout:10} var QQMenu=document.getElementById("QQMenu"); QQMenuInt(); </script> </textarea><br><input onclick="runEx('runcode11947')" type="button" value="运行代码"> <input onclick="doCopy('runcode11947')" type="button" value="复制代码"> <input onclick="doSave(runcode11947)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://%E5%8F%AF%E6%B5%AE%E5%8A%A8QQ%E5%9C%A8%E7%BA%BF%E5%AE%A2%E6%9C%8D_javascript%E6%8A%80%E5%B7%A7/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div> <br><a href="http://img.jb51.net/online/qq/qq.rar" target="_blank">打包下载</a> </div>