蓝色展开收缩悬浮QQ客服代码
放在我的博客首页上的的预览图:
在文章区的预览图如下:
代码如下:
<div class="scrollsidebar" id="scrollsidebar">
<div class="side_content">
<div class="side_list">
<div class="side_title"><a title="隐藏" class="close_btn"><span>关闭</span></a></div>
<div class="side_center">
<div class="custom_service">
<p> <a title="点击这里给我发消息" href="tencent://message/?uin=2669803073&Site=https://www.cnblogs.com/qrk666/&Menu=yes" target="_blank"><img src="http://wpa.qq.com/pa?p=2:8983659:41"></a> </p>
</div>
<div class="other">
<p><img src="https://images.cnblogs.com/cnblogs_com/qrk666/1750660/o_200504090346AD4BE6AC10146679D7FC4C3718A63A37.jpg" width="120"/></p>
<p>QQ</p>
<p>2669803073</p>
</div>
<div class="msgserver">
<p><a href="tencent://message/?uin=2669803073&Site=https://www.cnblogs.com/qrk666/&Menu=yes" >联系</a></p>
</div>
</div>
<div class="side_bottom"></div>
</div>
</div>
<div class="show_btn"><span>在线客服</span></div>
</div> <script type="text/javascript">!(function() {
var serviceOnline = (function() {
var sideContent = document.querySelector(".side_content");
var show_btn = document.querySelector(".show_btn");
var close_btn = document.querySelector(".close_btn");
var timer = null; //悬浮QQ匀速移动
var startMove = function(argument) {
var scrollsidebar = document.getElementById("scrollsidebar");
clearInterval(timer);
timer = setInterval(function() {
var speed = (argument - scrollsidebar.offsetTop) / 4;
speed = speed > 0 ? Math.ceil(speed) : Math.floor(speed);
if (argument == scrollsidebar.offsetTop) {
clearInterval(timer);
} else {
scrollsidebar.style.top = scrollsidebar.offsetTop + speed + "px";
}
}, 20);
}; //鼠标移动
var scrollMove = function() {
window.onscroll = window.onload = function() {
var scrollsidebar = document.getElementById("scrollsidebar");
var scrolltop =
document.body.scrollTop || document.documentElement.scrollTop;
startMove(
parseInt(
(document.documentElement.clientHeight -
scrollsidebar.offsetHeight) /2 +scrolltop
)
);
};
}; //悬浮QQ显示
var slideShow = function() {
if (!show_btn) return false;
show_btn.addEventListener(
"click",
function() {
show_btn.style.width = 0;
sideContent.style.width = "154px";
},
false
);
}; //悬浮QQ隐藏
var slideClose = function() {
if (!close_btn) return false;
close_btn.addEventListener(
"click",
function() {
console.log(this);
sideContent.style.width = 0;
show_btn.style.width = "25px";
},
false
);
}; //返回出来的方法
return {
init: function() {
scrollMove();
slideClose();
slideShow();
}
};
})(); //初始化
serviceOnline.init();
})();</script>
/*下面是加QQ弹框c's's*/
html {overflow-x:hidden;} .custom_service p img {display: inline; vertical-align:middle;}
.scrollsidebar{position:absolute; z-index:; top:350px;right:}
.side_content{width:154px; height:auto; overflow:hidden; float:left; }
.side_content .side_list {width:154px;overflow:hidden;}
.show_btn{ width:; height:112px; overflow:hidden; margin-top:50px; float:left; cursor:pointer;}
.show_btn span { display:none;}
.close_btn{width:24px;height:24px;cursor:pointer;}
.side_title,.side_bottom,.close_btn,.show_btn {background:url(../images/sidebar_bg.png) no-repeat;}
.side_title {height:46px;}
.side_bottom { height:8px;}
.side_center {font-family:Verdana, Geneva, sans-serif; padding:5px 12px; font-size:12px;}
.close_btn { float:right; display:block; width:21px; height:16px; margin:16px 10px 0 0; _margin:16px 5px 0 0;}
.close_btn span { display:none;}
.side_center .custom_service p { text-align:center; padding:6px 0; margin:; vertical-align:middle;}
.other { text-align:center;border-bottom:1px solid #ddd;border-top:1px solid #ddd}
.other p { padding:5px 0; _height:16px; margin:;color: #666666;}
.msgserver { text-align:center; margin-bottom:5px;}
.msgserver a { background:url(../images/sidebar_bg.png) no-repeat -119px -115px; padding-left:22px;} /* blue skin as the default skin */
.side_title, .side_blue .side_title {background-position:-195px 0;}
.side_center, .side_blue .side_center {background:url(../images/blue_line.png) repeat-y center;}
.side_bottom, .side_blue .side_bottom {background-position:-195px -50px;}
.close_btn, .side_blue .close_btn {background-position:-44px 0;}
.close_btn:hover, .side_blue .close_btn:hover {background-position:-66px 0;}
.show_btn , .side_blue .show_btn {background-position:-119px 0;}
.msgserver a, .side_blue .msgserver a {color:#06C;} /* green skin */
.side_green .side_title {background-position:-349px 0;}
.side_green .side_center {background:url(../images/green_line.png) repeat-y center;}
.side_green .side_bottom {background-position:-349px -50px;}
.side_green .close_btn {background-position:-44px -23px;}
.side_green .close_btn:hover {background-position:-66px -23px;}
.side_green .show_btn {background-position:-147px 0;}
.side_green .msgserver a {color:#76a20c;}
注:可以直接使用,两段代码都要用上
蓝色展开收缩悬浮QQ客服代码的更多相关文章
- 基于jquery打造的网页右侧自动收缩浮动在线客服代码
基于jquery打造的网页右侧自动收缩浮动在线QQ客服代码, 当前比较流行的一款QQ在线jquery特效代码, 代码中还带有IE6下PNG图片透明的特效,如果想研究IE6下PNG透明的同学也可以下载研 ...
- jQuery网页右侧固定层显示隐藏在线qq客服代码
CSS代码: @charset "utf-8"; ;;} html,body{font-size:12px;font-family:"微软雅黑";outline ...
- QQ客服代码,支持临时会话
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=QQ号&site=qq&m ...
- 网页qq客服代码并自定义图片
<script>var online= new Array();</script> <script src="http://webpresence.qq.com ...
- qq客服代码实现过程
引入css,jsimages,将index.html中的qq聊天代码部分和返回顶部-部分放在head.html文件中, 将文中圈中部分删除,否则影响整个页面的样式:
- qq客服代码
http://shang.qq.com/v3/widget.html <a target="_blank" href="http://wpa.qq.com/msgr ...
- PC QQ客服代码
一. <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=QQ号&site=qq&am ...
- 网站QQ客服链接代码
个人QQ客服代码 <a href="tencent://message/?uin=QQ号码">在线咨询</a> 企业QQ客服代码 <a href=&q ...
- QQ,MSN,Skype在线客服代码
QQ,MSN,Skype在线客服代码 在网站建设时,为了更好的实施网站的营销型,会用到QQ,MSN等在线交流,以便客户能够快捷方便的联系我们.在这里,提供QQ,MSN的在线客服代码给大家分享: 1.Q ...
随机推荐
- C++语言实现顺序表
C++语言实现顺序表 顺序表的定义及其特点 顺序表的定义是:把线性表中的所有表项按照其逻辑顺序依次存储到从计算机存储中指定存储位置开始的一块连续的存储空间中. 这样,线性表中第一个表项的存储位置就是被 ...
- AD颗粒化密码规则策略
我们在第一次设定密码规则的时候,通常会在根节点或者默认组策略中设置 如果,我们在后期运维过程中,有一些特殊用户需要设置额外的密码策略,我们要如何操作呢? 可能,有些同学会在这些特殊用户对应的OU下在创 ...
- 【高并发】高并发环境下如何优化Tomcat配置?看完我懂了!
写在前面 Tomcat作为最常用的Java Web服务器,随着并发量越来越高,Tomcat的性能会急剧下降,那有没有什么方法来优化Tomcat在高并发环境下的性能呢? Tomcat运行模式 Tomca ...
- 创建 SysV 风格的 linux daemon 程序
本文介绍如何使用 C 语言创建 Linux 系统中 SysV 风格的 daemon 程序.注意:这是一种旧式的 daemon 程序写法,进入 systemd 时代后是不需要通过这样的方式创建 daem ...
- Linux C++ 网络编程学习系列(5)——多路IO之epoll边沿触发
多路IO之epoll边沿触发+非阻塞 源码地址:https://github.com/whuwzp/linuxc/tree/master/epoll_ET_LT_NOBLOCK_example 源码说 ...
- git撤销已经push到远端的commit
在使用git时,push到远端后发现commit了多余的文件,或者希望能够回退到以前的版本. 先在本地回退到相应的版本: git reset --hard <版本号> // 注意使用 -- ...
- [转] [知乎] 浅谈Roguelike
浅谈Roguelike 从柏林诠释说起 在2008年召开的国际Roguelike开发会议上,众多的Roguelike开发者与爱好者共同制定了<柏林诠释>,规定了Roguelike游戏需要具 ...
- Obtain The String CodeForces - 1295C binary_search+思维
妈耶,,,被B题卡到哭,C题一发就过了... 字符串问题.首先用vector记录每个字符出现的位置,然后对字符串t的每个字符,用二分查找函数查找,注意用upper_bound查找,对于字符i,首先用变 ...
- 详解 TreeMap
(有关Map集合的基本性质,请观看本人博文-- <详解 Map集合>) TreeMap: 特点: TreeMap 键不允许插入null 键的底层数据结构是红黑树,可保证键的排序和唯一性 线 ...
- SpringBoot集成Shiro实现权限控制
Shiro简介 Apache Shiro是一个功能强大且易于使用的Java安全框架,用于执行身份验证,授权,加密和会话管理.使用Shiro易于理解的API,您可以快速轻松地保护任何应用程序-从最小的移 ...