js QQ客服懸浮效果實(shí)現(xiàn)代碼
更新時(shí)間:2014年12月12日 15:27:43 投稿:mdxy-dxy
一段js實(shí)現(xiàn)的QQ客服懸浮特效代碼,經(jīng)常用在網(wǎng)頁上顯示QQ客服在線信息,很實(shí)用的一段代碼
代碼:
<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>QQ客服懸浮特效代碼_www.dbjr.com.cn</title> </head> <body style="height:2000px;"> <script type="text/javascript"> window.onload = window.onresize = window.onscroll = function () { var oBox = document.getElementById("qqbox_zzjs"); var oLine = document.getElementById("online_lanrenzhijia"); var oMenu = document.getElementById("menu_zzjs_net"); var iScrollTop = document.documentElement.scrollTop || document.body.scrollTop; setTimeout(function () { clearInterval(oBox.timer); var iTop = parseInt((document.documentElement.clientHeight - oBox.offsetHeight)/2) + iScrollTop; oBox.timer = setInterval(function () { var iSpeed = (iTop - oBox.offsetTop) / 8; iSpeed = iSpeed > 0 ? Math.ceil(iSpeed) : Math.floor(iSpeed); oBox.offsetTop == iTop ? clearInterval(oBox.timer) : (oBox.style.top = oBox.offsetTop + iSpeed + "px"); }, 30) }, 100) oBox.onmouseover = function () { this.style.width = 131 + "px"; oLine.style.display = "block"; oMenu.style.display = "none"; }; oBox.onmouseout = function () { this.style.width = ''; oLine.style.display = "none"; oMenu.style.display = "block"; }; }; document.write("<style>img{border:0;}ul,li{padding:0;margin:0;}.box_lanrenzhijia {z-index:99;right:0;width:128px;height:195px;position:absolute;}.box_lanrenzhijia .press{right:0;width:36px;cursor:pointer;position:absolute;height:128px;}.box_lanrenzhijia .zzjs_net_list{left:0;width:131px;position:absolute;height:195px;background:url(images/20120321lanrenzhijia_1.gif) no-repeat left center;}.box_lanrenzhijia .zzjs_net_list ul{padding:37px 0 0 21px;}.box_lanrenzhijia .zzjs_net_list li{height:26px;margin-bottom:3px;_margin-bottom:3px; list-style-type:none;}</style><div class=\"box_lanrenzhijia\" id=\"qqbox_zzjs\"><div class=\"zzjs_net_list\" id=\"online_lanrenzhijia\" style=\"display:none;\"><ul><li><a href=\"http://wpa.qq.com/msgrd?V=1&Uin=123456789&Site=腳本之家&Menu=yes\"><img src=\"images/20111126lanrenzhijia_3.gif\" alt=\"腳本之家一號(hào)客服\"></a></li><li><a href=\"http://wpa.qq.com/msgrd?V=1&Uin=123456789&Site=腳本之家&Menu=yes\"><img src=\"images/20111126lanrenzhijia_3.gif\" alt=\"腳本之家二號(hào)客服\"></a></li><li><a href=\"http://wpa.qq.com/msgrd?V=1&Uin=123456789&Site=腳本之家&Menu=yes\"><img src=\"images/20111126lanrenzhijia_3.gif\" alt=\"腳本之家三號(hào)客服\"></a></li><li><a href=\"http://wpa.qq.com/msgrd?V=1&Uin=123456789&Site=腳本之家&Menu=yes\"><img src=\"images/20111126lanrenzhijia_3.gif\" alt=\"腳本之家四號(hào)客服\"></a></li><li><a href=\"http://wpa.qq.com/msgrd?V=1&Uin=123456789&Site=腳本之家&Menu=yes\"><img src=\"images/20111126lanrenzhijia_3.gif\" alt=\"腳本之家五號(hào)客服\"></a></li></ul></div><div id=\"menu_zzjs_net\"><img src=\"images/20111126lanrenzhijia_4.gif\" class=\"press\" alt=\"在線客服\"></div></div>"); </script> </body> </html>
相關(guān)文章
js點(diǎn)擊彈出div層實(shí)現(xiàn)可拖曳的彈窗效果
點(diǎn)擊文字,彈出一個(gè)窗口,其實(shí)是一個(gè)彈出層,這個(gè)彈出層可以隨鼠標(biāo)拖曳,很炫的哦,另外,示例演示了用本方法彈出文字層和彈出圖片層的具體代碼,請(qǐng)根據(jù)選擇使用哦,感興趣的朋友可以研究下2012-12-12據(jù)說是Google首頁的網(wǎng)頁模塊拖動(dòng)代碼
據(jù)說是Google首頁的網(wǎng)頁模塊拖動(dòng)代碼,Google很早就應(yīng)用了網(wǎng)頁拖動(dòng)特效,不知大家發(fā)現(xiàn)沒?本款拖動(dòng)特效可以說是完全模仿了Google的拖動(dòng)代碼,比較有代表性,因此也很有參考價(jià)值,奉獻(xiàn)給大家,僅供參考。2010-09-09帶你快速上手前端響應(yīng)式布局與Bootstrap柵格系統(tǒng)
這篇文章帶你快速上手前端響應(yīng)式布局與Bootstrap柵格系統(tǒng),響應(yīng)式布局主要是針對(duì)各種不同尺寸的屏幕兼容性問題,需要的朋友可以參考下2023-03-03仿Discuz!的論壇評(píng)分發(fā)帖彈出提示并漸漸消失的效果
仿Discuz!論壇評(píng)分發(fā)帖彈出提示并漸漸消失的效果,相信不少朋友都見到過這效果吧2010-10-10