绿色背景在线客服悬浮代码js

吴柏松 2019-11-22 73 阅读

特效描述:jQuery 绿色的qq在线客服 点击返回顶部,jQuery超出屏幕高度,出现返回顶部,在线客服代码

代码部署教程

1. 引入CSS

<link type="text/css" rel="stylesheet" href="style.css">

2. 引入JS

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

3. HTML代码

<div class="wrap-box"></div>
<div class="fixed-bar">
<div class="wide-bar">
<div class="consult-box">
<div class="consult-header clearfix">
<h3 class="consult-title">免费咨询</h3>
</div>
<ul class="consult-list">
<li class="clearfix">
<span>汪先生:</span>
<a target="_blank" href=""><img border="0" src="http://cxvn.oss-cn-beijing.aliyuncs.com/images/JS_qq.png" alt="QQ" title="点击开始QQ交谈/留言"></a>
</li>
<li class="clearfix">
<span>汪先生:</span>
<a target="_blank" href=""><img border="0" src="http://cxvn.oss-cn-beijing.aliyuncs.com/images/JS_qq.png" alt="QQ" title="点击开始QQ交谈/留言"></a>
</li>
<li class="clearfix">
<span>汪先生:</span>
<a target="_blank" href=""><img border="0" src="http://cxvn.oss-cn-beijing.aliyuncs.com/images/JS_qq.png" alt="QQ" title="点击开始QQ交谈/留言"></a>
</li>
<li class="clearfix">
<span>汪先生:</span>
<a target="_blank" href=""><img border="0" src="http://cxvn.oss-cn-beijing.aliyuncs.com/images/JS_qq.png" alt="QQ" title="点击开始QQ交谈/留言"></a>
</li>
<li class="clearfix"><span class="tel-icon">400-609-0922</span></li>
<li class="clearfix"><span class="tel-icon">0755-32956099</span></li>
<li class="clearfix"><span class="tel-icon">0755-32956199</span></li>
</ul>
</div>
<a href="javascript:scrollTo(0,0)" class="gotop" title="回到顶部" style="display:none;"><i class="icon">返回顶部</i><span>返回顶部</span></a>
</div>
</div>
<script type="text/javascript">
$(document).scroll(function(){
var scrollTop = $(document).scrollTop(),bodyHeight = $(window).height();
if(scrollTop > bodyHeight){
$('.fixed-bar .gotop').css('display','block');
}else{
$('.fixed-bar .gotop').css('display','none');
}
})
</script>

演示地址下载地址

最新游戏