jQuery實(shí)現(xiàn)懸浮在右上角的網(wǎng)頁(yè)客服效果代碼
本文實(shí)例講述了jQuery實(shí)現(xiàn)懸浮在右上角的網(wǎng)頁(yè)客服效果代碼。分享給大家供大家參考,具體如下:
這是款網(wǎng)頁(yè)在線客服代碼,應(yīng)用了jquery插件,兼容性不錯(cuò)。默認(rèn)狀態(tài)下,客服只顯示一個(gè)圖片Button,用鼠標(biāo)點(diǎn)擊時(shí)展開全部?jī)?nèi)容,可用作QQ客服,售后客服等,可以作為網(wǎng)站快速通道,方便用戶進(jìn)行相應(yīng)的操作。
運(yùn)行效果截圖如下:

在線演示地址如下:
http://demo.jb51.net/js/2015/jquery-right-top-wen-online-demo/
具體代碼如下:
<!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=gb2312">
<style type="text/css">
.demo_menu{font-size: 14px;text-align: center;margin: 10px 0 0 0;color: #999;line-height: 180%;}
.demo_menu b{color: #333;}
.demo_menu a, .demo_menu a: visited{color: #F00;font-size: 14px;}
.demo_menu a: hover{color: #090;font-size: 14px;}
body{background: #ccc;}
.text{font-size: 12px;}
#kefu{position: fixed;_position: absolute;_top: expression(documentElement.scrollTop + 20 + "px");top: 20px;right: 0;z-index: 999}
#kefu .box-content{position: relative;background-color: #fff;width: 170px;}
#kefu .title-btn, #kefu .qq, #kefu .phone, #kefu .service, #kefu .on span{background: url(images/kefu.png) no-repeat}
#kefu .title-btn{width: 33px;height: 97px;position: absolute;top: 0;left: -33px;}
#kefu .title-btn span{display: none}
#kefu .on span{background-position: -129px 7px;height: 16px;display: block;}
#kefu .pad{padding: 16px 10px 10px;overflow: hidden;font-size: 12px;}
#kefu .pad a{text-decoration: none;}
#kefu .qq{background-position: 0 -118px;display: inline-block;zoom: 1;*display: inline;padding-left: 16px;}
#kefu .phone{height: 28px;background-position: 0 -153px;margin: 18px 0}
#kefu .service{display: inline-block;zoom: 1;*display: inline;height: 51px;background-position: 0 -203px;width: 151px;margin-left: 3px}
#kefu .text{background-color: #ededed;padding: 5px 10px;text-align: center}
#kefu .off{width: 0;}
#kefu .off .pad, #kefu .off .text{display: none}
p, p a{font-size: 12px;color: #666;}
</style>
<title>始終固定在網(wǎng)頁(yè)右上角的在線客服QQ代碼</title>
<meta http-equiv="X-UA-Compatible" content="IE=7">
<script src="jquery-1.6.2.min.js" type="text/javascript"></script>
</head>
<body>
<div id="kefu">
<div class="box-content off">
<div class="title-btn cu"><span><a href="#"></a></span></div>
<div class="pad"> <a class="qq" style="margin-right:16px">售前咨詢</a><a class="qq">廣告-合作</a>
<div class="phone"></div>
<a href="#" class="service" target="_blank"></a> </div>
<div class="text"> 客服時(shí)間:(9:00-18:00)<br>
(周六日休息) </div>
</div>
</div>
<script type="text/javascript">
$(".select").hover(
function () {
$(this).find(".msgNav").show();
},
function () {
$(this).find(".msgNav").hide();
}
);
$(".title-btn").toggle(
function () {
$(this).addClass("on");
$(this).parent(".box-content").removeClass("off");
},
function () {
$(this).removeClass("on");
$(this).parent(".box-content").addClass("off");
}
);
</script>
</body>
</html>
希望本文所述對(duì)大家jQuery程序設(shè)計(jì)有所幫助。
- jquery鼠標(biāo)放上去顯示懸浮層即彈出定位的div層
- jquery實(shí)現(xiàn)的可隱藏重現(xiàn)的靠邊懸浮層實(shí)例代碼
- 使用jQuery UI的tooltip函數(shù)修飾title屬性的氣泡懸浮框
- 自定義一個(gè)jquery插件[鼠標(biāo)懸浮時(shí)候 出現(xiàn)說明label]
- jquery實(shí)現(xiàn)鼠標(biāo)懸浮停止輪播特效
- jquery懸浮提示框完整實(shí)例
- 鼠標(biāo)懸浮顯示二級(jí)菜單效果的jquery實(shí)現(xiàn)
- jQuery簡(jiǎn)單實(shí)現(xiàn)頁(yè)面元素置頂時(shí)懸浮效果示例
- jQuery鼠標(biāo)懸浮鏈接彈出跟隨圖片實(shí)例代碼
- jQuery實(shí)現(xiàn)的簡(jiǎn)單懸浮層功能完整實(shí)例
相關(guān)文章
jQuery scroll事件實(shí)現(xiàn)監(jiān)控滾動(dòng)條分頁(yè)示例
這篇文章主要介紹了jQuery scroll事件實(shí)現(xiàn)監(jiān)控滾動(dòng)條分頁(yè)簡(jiǎn)單示例,使用ajax加載,同時(shí)介紹了(document).height()與$(window).height()的區(qū)別,需要的朋友可以參考下2014-04-04
jquery實(shí)現(xiàn)全屏滾動(dòng)效果
這篇文章主要為大家詳細(xì)介紹了jquery實(shí)現(xiàn)全屏滾動(dòng)效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-08-08
使用DataTable插件實(shí)現(xiàn)異步加載數(shù)據(jù)
本文給大家分享的是Jquery+dataTable插件來實(shí)現(xiàn)異步加載數(shù)據(jù)的示例代碼,非常實(shí)用,有需要的小伙伴可以參考下2017-11-11
使用jQuery不判斷瀏覽器高度解決iframe自適應(yīng)高度問題
這篇文章主要介紹了使用jQuery不判斷瀏覽器高度解決iframe自適應(yīng)高度問題,需要的朋友可以參考下2014-12-12
MultiSelect左右選擇控件的設(shè)計(jì)與實(shí)現(xiàn)介紹
由于項(xiàng)目中用到左右選擇的控件,網(wǎng)上找了一些相關(guān)的實(shí)現(xiàn),基本上有兩個(gè):1、基于JQuery UI的控件2、某個(gè)兄弟手寫的一個(gè)控件,具體實(shí)現(xiàn)如下,感興趣的朋友可以參考下哈2013-06-06
jQuery修改li下的樣式以及l(fā)i下的img的src的值的方法
這篇文章主要為大家介紹了jQuery如何修改li下的樣式,以及修改li下的img的src的值,示例代碼很簡(jiǎn)單,一看就會(huì)2014-11-11
運(yùn)用jQuery寫的驗(yàn)證表單(實(shí)例講解)
下面小編就為大家?guī)硪黄\(yùn)用jQuery寫的驗(yàn)證表單(實(shí)例講解)。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-07-07
Jquery實(shí)現(xiàn)點(diǎn)擊按鈕,連續(xù)地向textarea中添加值的實(shí)例代碼
本篇文章主要是對(duì)Jquery實(shí)現(xiàn)點(diǎn)擊按鈕,連續(xù)地向textarea中添加值的實(shí)例代碼進(jìn)行了介紹,需要的朋友可以過來參考下,希望對(duì)大家有所幫助2014-03-03
jQuery實(shí)現(xiàn)單擊彈出Div層窗口效果(可關(guān)閉可拖動(dòng))
這篇文章主要介紹了jQuery實(shí)現(xiàn)單擊彈出Div層窗口效果,具有可關(guān)閉可拖動(dòng)的功能,涉及jQuery響應(yīng)鼠標(biāo)事件動(dòng)態(tài)變換頁(yè)面元素樣式的實(shí)現(xiàn)技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2015-09-09

