經常可以看到大部分的官網有右側懸浮在線客服。今天來寫寫!
效果圖:

代碼如下:
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>js懸浮窗代碼(支持拖動)</title><meta name="description" content="js浮動層特效制作懸浮在線客服代碼,放置在線QQ等聊天按鈕的在線客服浮動層代碼,支持拖動效果,可隨意在頁面上拖動位置,隨著瀏覽器滾動始終保持在懸浮在頁面上的js代碼。" /></head><body><style type="text/css">*{margin:0;padding:0;list-style-type:none;}a,img{border:0;}/* KeFuDiv */.KeFuDiv{position:absolute;height:160px;width:196px;background: #01C4C6;color:#fff;font-size:20px;text-align: center;cursor: pointer;}.KeFuDiv p{line-height: 80px;font-weight:bold;}</style><div style="height:3000px;"></div><div id="KeFuDiv" class="KeFuDiv" onmousedown="MoveDiv(KeFuDiv,event);"> <p> Content Me!!!<br> 我可以拖動哦!!! </p></div><!--KeFuDiv end--><script type="text/javascript" src="http://7xnlea.com2.z0.glb.qiniucdn.com/online.js"></script><script type="text/javascript">//初始位置gID("KeFuDiv").style.top = (document.documentElement.clientHeight - gID("KeFuDiv").offsetHeight)/2 +"px";gID("KeFuDiv").style.left = document.documentElement.clientWidth - gID("KeFuDiv").offsetWidth +"px";//開始滾動ScrollDiv('KeFuDiv');</script></body></html>以上就是本文的全部內容,希望本文的內容對大家的學習或者工作能帶來一定的幫助,同時也希望多多支持武林網!
新聞熱點
疑難解答