蓝色右侧悬浮层收缩qq在线客服js代码

车险平台 2019-11-22 308 阅读

特效描述:jquery右侧悬浮层 可收缩展开 在线客服 在线问答QQ,jquery浮动层特效制作右侧侧边悬浮层在线客服代码,点击在线客服按钮展开在线客服信息,随着浏览器鼠标滚动,悬浮在线客服固定在页面中间。

代码部署教程

1. 引入JS

<script type="text/javascript" src="js/jquery-1.4.2.min.js">
</script>

2. HTML代码

<div style="height:1000px;">
</div>

<script type="text/javascript">

$(document).ready(function(){
$("#floatShow").bind("click",function(){
$("#onlineService").animate({width:"show", opacity:"show"}, "normal" ,function(){
$("#onlineService").show();
});
$("#floatShow").attr("style","display:none");
$("#floatHide").attr("style","display:block");
return false;
});
$("#online_qq_layer").bind("click",function(){
$("#onlineService").animate({width:"hide", opacity:"hide"}, "normal" ,function(){
$("#onlineService").hide();
});
$("#floatShow").attr("style","display:block");
$("#floatHide").attr("style","display:none");
return false;
});
});
</script>

<style type="text/css">

*{margin:0;padding:0;list-style-type:none;}
a,img{border:0;}
/* online */
#online_qq_tab a,.onlineMenu h3,.onlineMenu li.tli,.newpage{background:url(images/float_s.gif) no-repeat;}
#onlineService,.onlineMenu,.btmbg{background:url(images/float_bg.gif) no-repeat;}
#online_qq_layer{z-index:9999;position:fixed;right:0px;top:0;margin:150px 0 0 0;}
*html,*html body{background-image:url(about:blank);background-attachment:fixed;}
*html #online_qq_layer{position:absolute;top:expssion(eval(document.documentElement.scrollTop));}
#online_qq_tab{width:28px;float:left;margin:120px 0 0 0;position:relative;z-index:9;}
#online_qq_tab a{display:block;height:118px;line-height:999em;overflow:hidden;}
#online_qq_tab a#floatShow{background-position:-30px -374px;}
#online_qq_tab a#floatHide{background-position:0 -374px;}
#onlineService{display:inline;margin-left:-1px;float:left;width:130px;display:none;background-position:0 0;padding:10px 0 0 0;}
.onlineMenu{background-position:-262px 0;background-repeat:repeat-y;padding:0 15px;}
.onlineMenu h3{height:36px;line-height:999em;overflow:hidden;border-bottom:solid 1px #ACE5F9;}
.onlineMenu h3.tQQ{background-position:0 10px;}
.onlineMenu h3.tele{background-position:0 -47px;}
.onlineMenu li{height:36px;line-height:36px;border-bottom:solid 1px #E6E5E4;text-align:center;}
.onlineMenu li.tli{padding:0 0 0 28px;font-size:12px;text-align:left;}
.onlineMenu li.zixun{background-position:0px -131px;}
.onlineMenu li.fufei{background-position:0px -190px;}
.onlineMenu li.phone{background-position:0px -244px;}
.onlineMenu li a.newpage{display:block;height:36px;line-height:999em;overflow:hidden;background-position:5px -100px;}
.onlineMenu li img{margin:8px 0 0 0;}
.onlineMenu li.last{border:0;}
.wyzx{padding:8px 0 0 5px;height:57px;overflow:hidden;background:url(images/webZx_bg.jpg) no-repeat;}
.btmbg{height:12px;overflow:hidden;background-position:-131px 0;}
</style>

<div id="online_qq_layer">

<div id="online_qq_tab">

<a id="floatShow" style="display:block;" href="javascript:void(0);">

收缩</a>

<a id="floatHide" style="display:none;" href="javascript:void(0);">

展开</a>

</div>

<div id="onlineService">

<div class="onlineMenu">

<h3 class="tQQ">

QQ在线客服</h3>

<ul>

<li class="tli zixun">

在线咨询</li>

<li>

<a href="http://www.cxvn.com/">

<img src="images/pa.gif" width="74" height="22" alt="客服001" />

</a>

</li>

<li>

<a href="http://www.cxvn.com/">

<img src="images/pa.gif" width="74" height="22" alt="客服001" />

</a>

</li>

<li class="tli fufei">

付费学员</li>

<li class="last">

<a href="http://www.cxvn.com/">

<img src="images/pa.gif" width="74" height="22" alt="客服001" />

</a>

</li>

</ul>

</div>

<div class="wyzx">

<a href="http://www.cxvn.com/">

<img src="images/right_float_web.png" width="122" height="50" alt="网页咨询" />

</a>

</div>

<div class="onlineMenu">

<h3 class="tele">

QQ在线客服</h3>

<ul>

<li class="tli phone">

4008-517-517</li>

<li class="last">

<a class="newpage" href="http://www.cxvn.com/">

新版调查</a>

</li>

</ul>

</div>

<div class="btmbg">

</div>

</div>

</div>

演示地址下载地址

最新游戏