首页 > 特效插件 > 在线客服 >  蓝色固定在右边的QQ在线咨询框jQuery代码正文

蓝色固定在右边的QQ在线咨询框jQuery代码

特效介绍
QQ在线咨询框jQuery代码

    蓝色固定在右边的QQ在线咨询框jQuery代码,点击在线客服,展开和收起。还具有网页咨询和电话咨询的功能!
使用方法
1、在head区域引入下面的js文件和css文件:
<link href="css/style.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://www.5imoban.net/download/jquery/jquery-1.8.3.min.js"></script>
2、js代码:
<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>
3、css代码:
<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:expression(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>
4、html代码:
<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="#"><img src="images/pa.gif" width="74" height="22" alt="客服001" /></a></li>
                <li><a href="#"><img src="images/pa.gif" width="74" height="22" alt="客服001" /></a></li>
                <li class="tli fufei">付费学员</li>
                <li class="last"><a href="#"><img src="images/pa.gif" width="74" height="22" alt="客服001" /></a></li>
            </ul>
        </div>
        <div class="wyzx">
            <a href="#"><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">400-517-517</li>
                <li class="last"><a class="newpage" href="#">新版调查</a></li>
            </ul>
        </div>
        <div class="btmbg"></div>
    </div>
</div>