放在我的博客首页上的的预览图:

在文章区的预览图如下:

代码如下:

<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客服代码的更多相关文章

  1. 基于jquery打造的网页右侧自动收缩浮动在线客服代码

    基于jquery打造的网页右侧自动收缩浮动在线QQ客服代码, 当前比较流行的一款QQ在线jquery特效代码, 代码中还带有IE6下PNG图片透明的特效,如果想研究IE6下PNG透明的同学也可以下载研 ...

  2. jQuery网页右侧固定层显示隐藏在线qq客服代码

    CSS代码: @charset "utf-8"; ;;} html,body{font-size:12px;font-family:"微软雅黑";outline ...

  3. QQ客服代码,支持临时会话

    <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=QQ号&site=qq&m ...

  4. 网页qq客服代码并自定义图片

    <script>var online= new Array();</script> <script src="http://webpresence.qq.com ...

  5. qq客服代码实现过程

    引入css,jsimages,将index.html中的qq聊天代码部分和返回顶部-部分放在head.html文件中, 将文中圈中部分删除,否则影响整个页面的样式:

  6. qq客服代码

    http://shang.qq.com/v3/widget.html <a target="_blank" href="http://wpa.qq.com/msgr ...

  7. PC QQ客服代码

    一. <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=QQ号&site=qq&am ...

  8. 网站QQ客服链接代码

    个人QQ客服代码 <a href="tencent://message/?uin=QQ号码">在线咨询</a> 企业QQ客服代码 <a href=&q ...

  9. QQ,MSN,Skype在线客服代码

    QQ,MSN,Skype在线客服代码 在网站建设时,为了更好的实施网站的营销型,会用到QQ,MSN等在线交流,以便客户能够快捷方便的联系我们.在这里,提供QQ,MSN的在线客服代码给大家分享: 1.Q ...

随机推荐

  1. django->model模型操作(数据库操作)

    一.字段类型 二.字段选项说明 三.内嵌类参数说明abstract = Truedb_table = 'table_name' #表名,默认的表名是app_name+类名ordering = ['id ...

  2. String 对象-->substring() 方法

    1.定义和用法 substring() 方法用于提取两个指定下标之间的字符. substring() 方法返回的子串包括 开始 处的字符,但不包括 结束 处的字符 语法: string.substri ...

  3. 类 文件 右下角呈现 红色小圆圈,里面有一个J 标记

    intellj(idea) 项目中类 文件 右下角呈现 红色小圆圈,里面有一个J 标记,表明此为 未设置为源文件,没有编译,本来应该是属于源文件的,结果现在没有被标记为源文件,也就没法编译了.

  4. RNN循环神经网络(Recurrent Neural Network)学习

    一.RNN简介 1.)什么是RNN? RNN是一种特殊的神经网络结构,考虑前一时刻的输入,且赋予了网络对前面的内容的一种'记忆'功能. 2.)RNN可以解决什么问题? 时间先后顺序的问题都可以使用RN ...

  5. Ajax 简述与基础语法

    目录 Ajax 1. 原生 JS 实现 Ajax 2. 使用 Ajax 实现异步通信 a. Ajax 的基础语法 b. 用 Ajax 传递数据 i. 传递字符串数据 ii. 传递 JSON 数据 3. ...

  6. Mysql使用终端操作数据库

      使用终端操作数据库       1.如何查看有什么数据库?     show databases;        2.如何选择数据库?    use databasesName;       3. ...

  7. 高校战“疫”网络安全分享赛 Misc ez_mem&usb

    打开之后是一个流量包 用wireshark导出HTTP文件,有个upload,用一下binwalk,出来了一个镜像文件 用volatility搜一下,命令里有一个密码,看见了但是后来给忘了... 文件 ...

  8. C#栈、堆的理解(2)

    接上一遍博文有关值类型和引用类型的相关概念. 所有值类型数据存放:栈(内存) 引用类型的数据存放:堆(内存) 栈:可以认为是一本书的目录部分称其为栈.栈可快速检索,运行速度比堆大,而且栈的空间小得多. ...

  9. 深入浅出webpack笔记

    1.CommonJS CommonJS是一种被广泛使用的JavaScript模块化规范,其核心思想是用过require方法来同步加载依赖的其他模块,通过moudle.exports导出需要暴露的接口, ...

  10. ansible playbook loop 翻译

    ansible源文档地址 有时候你想多次重复一个任务. 在计算机编程中,这叫做循环. 常见的 Ansible 循环包括使用文件模块更改几个文件和 / 或目录的所有权,使用用户模块创建多个用户,并重复一 ...