<!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>Jquery之客服</title>
<style type="text/css">
.box{width:120px;
height:300px;
left:0px;
top:20%;
position:fixed;
background:blue;
border-radius: 6px;
padding:4px;}
.click{position:absolute;
right:-25px;
top:100px;
width:18px;
height:100px;
background-color:#00a0e8;
border-radius: 6px 0px 0px 6px;
text-align:center;
padding:5px;
color:white;}
.box .kf{width:120px;
height:240px;
background:#FFF;
border-radius: 6px;}
a{width: 100%;
height: 20px;
font-size:12px;
display: block;
margin: 6px auto;
text-align:center;
color:gray;
text-decoration:none;}
.box .wy,.box .sj{width: 100%;
height:20px;
background:#FFF;
border-radius: 6px;}
a:hover{color:blue;}
</style>
<script type="text/javascript" src=".../jquery-3.2.1/jquery-3.2.1.min.js"></script>
<script>
$(document).ready(function(e) {
//点击鼠标,显示客户
$("#box").css('left','-130px');
$("#click").click(
function(){
$(this).parent().animate({left:"0px"});
}
);
//鼠标移动到上面,隐藏客服
$("#click").mouseover(
function(){
$(this).parent().animate({left:"-130px"});
}
);
});
</script>
</head>
<body>
<div id="box" class="box">
<label id="click" class="click">在线客服</label>
<div id="kf" class="kf">
<a href="#">在线客服1</a>
<a href="#">在线客服2</a>
<a href="#">在线客服3</a>
<a href="#">在线客服4</a>
<a href="#">在线客服5</a>
<a href="#">在线客服6</a>
<a href="#">在线客服7</a>
<a href="#">在线客服8</a>
<a href="#">在线客服9</a>
</div>
<div id="wy" class="wy">
<a href="#">网页客服</a>
</div>
<div id="sj" class="sj">
<a href="#">手机客服</a>
</div>
</div>
</body>
</html>