悬浮qq在线客服代码,jquery动感在线客服特效

南东北西的小说 2019-11-22 35 阅读

特效描述:利用jquery实现 动感在线客服,利用jquery实现动感在线客服特效

代码部署教程

1. 引入CSS

<link rel="stylesheet" href="css/kefu.css">

2. 引入JS

<script src="js/jquery.js"></script>

<script src="http://webpsence.qq.com/getonline?Type=1&645481746:1712816412:645481746:"></script>

3. HTML代码

<div id="box-kefu">
<div class="kefu-close"></div>
<div class="kefu-open">
<div>
<ul>
<li><a href="http://www.cxvn.com/msgrd?v=3&uin=645481746&site=qq&menu=yes" target="_blank"><i class="qq"></i>在线客服1</a></li>
<li><a href="http://www.cxvn.com/msgrd?v=3&uin=1712816412&site=qq&menu=yes" target="_blank"><i class="qq"></i>在线客服2</a></li>
<li><a href="http://www.cxvn.com/msgrd?v=3&uin=645481746&site=qq&menu=yes" target="_blank"><i class="qq"></i>在线客服3</a></li>
<li><a href="http://www.cxvn.com/plus/guestbook.php#liuyan" target="_blank"><i class="txt"></i>咨询留言</a></li>
</ul>
</div>
<a href="javascript:;" class="close">关闭</a>
</div>
</div>
<script>var online= new Array();</script>
<script>
(function($){
for (var i=0; i<online.length; i++) {
if (online[i]) jQuery("#box-kefu .qq").eq(i).addClass("online");
}
var _open = $("#box-kefu").find(".kefu-open"),
_close = $("#box-kefu").find(".kefu-close");
_open.find("a").hover(function(){
$(this).stop(true,true).animate({paddingLeft:20},200).find("i").stop(true,true).animate({left:75},200);
},function(){
$(this).stop(true,true).animate({paddingLeft:35},200).find("i").stop(true,true).animate({left:10},200);
});
_open.find(".close").click(function(){
_open.animate({width:148},200,function(){
_open.animate({width:0},200,function(){
_close.animate({width:34},200);
});
});
});
_close.click(function(){
_close.animate({width:44},200,function(){
_close.animate({width:0},200,function(){
_open.animate({width:138},200);
});
});
});
})(jQuery)
</script>
<div style="text-align:center;clear:both">
</div>

演示地址下载地址

最新游戏