常用右侧悬浮代码 在线悬浮客服

HTML:

<!-- 悬浮按钮 电脑版 -->
<link rel="stylesheet" href="http://at.alicdn.com/t/font_2038320_8anyy3dexnb.css">
<div class="xf-btn uk-visible@m">
<ul>
<li class="zixun">
<a href="{$config.zixun.linkurl}">
<i class="iconfont icon-zixunbeifen"></i>
<p>在线咨询</p>
</a>
</li>
<li class="weixin">
<a href="javascript:;">
<i class="iconfont icon-weixin"></i>
<p>微信咨询</p>
</a>
<div uk-dropdown="pos:left-center;offset:10;delay-hide:0">
<img src="{$config.zixun.weixin.filename}" alt="" width="100">
</div>
</li>
<li class="tel">
<a href="tel:{$config.zixun.hotline}">
<div class="uk-flex uk-flex-middle">
<div class="xf-tel-btn">
<i class="iconfont icon-dian_hua"></i>
<p>热线电话</p>
</div>
<div class="xf-tel">{$config.zixun.hotline}</div>
</div>
</a>
</li>
<li class="totop">
<a href="#" uk-scroll>
<i class="iconfont icon-fanhuidingbu"></i>
<p>返回顶部</p>
</a>
</li>
</ul>
</div>

CSS代码:

/** 悬浮按钮 **/
.xf-btn{
    position: fixed;
    right: 0;
    top: 30%;
    z-index: 2000;
}
.xf-btn ul{
    margin: 0;
    padding: 0;
    position: relative;
}
.xf-btn ul li{
    list-style: none;
    margin-bottom: 1px;
    position: absolute;
}
.xf-btn ul li a{
    display: block;
    width: 80px;
    height: 70px;
    background-color: #222222;
    color: #fff;
    text-align: center;
}
.xf-btn ul li a:hover{
    text-decoration: none;
    background-color: #1d77d6;
}
.xf-btn ul li a i{
    font-size: 24px;
    line-height: 24px;
    margin-top: 12px;
    display: inline-block;
}
.xf-btn ul li p{
    font-size: 12px;
    line-height: 20px;
    margin-top: 0;
    margin-bottom: 0;
    font-weight: 300;
}
.xf-btn li.zixun{
    right: 0;
    top: 0;
}
.xf-btn li.weixin{
    right: 0;
    top: 71px;
}
.xf-btn li.totop{
    right: 0;
    top: 142px;
}
.xf-btn li.tel{
    left: -80px;
    top: 213px;
}
.xf-btn li.tel a{
    width: 280px;
    transition: all 0.5s;
}
.xf-btn li.tel:hover a{
    transform: translateX(-200px);
}
.xf-tel-btn{
    width: 80px;
    text-align: center;
}
.xf-tel{
    font-size: 28px;
    margin-top: 10px;
}

.xf-btn li a{
    transition: all 0.3s;
}
.xf-btn li.zixun a:hover{
    padding: 0 15px 0 0;
}
.xf-btn li.liuyan a:hover{
    padding: 0 15px 0 0;
}
.xf-btn li.totop a:hover{
    padding: 0 15px 0 0;
}
.xf-btn li.weixin .uk-dropdown{
    background: none;
    box-shadow: none;
    min-width: 127px;
    max-width: 127px;
    padding: 10px;
    background-image: url(../images/ewmbg.png);
    background-size: contain;
}