欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

js QQ客服悬浮效果实现代码

程序员文章站 2023-12-03 08:15:10
代码:

代码:

<!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>qq客服悬浮特效代码_www.jb51.net</title>
</head>
<body style="height:2000px;">
<script type="text/javascript">
window.onload = window.onresize = window.onscroll = function ()
{
 var obox = document.getelementbyid("qqbox_zzjs");
 var oline = document.getelementbyid("online_lanrenzhijia");
 var omenu = document.getelementbyid("menu_zzjs_net");
 var iscrolltop = document.documentelement.scrolltop || document.body.scrolltop;
 settimeout(function ()
 {
 clearinterval(obox.timer);
 var itop = parseint((document.documentelement.clientheight - obox.offsetheight)/2) + iscrolltop;
 obox.timer = setinterval(function ()
 {
  var ispeed = (itop - obox.offsettop) / 8;
  ispeed = ispeed > 0 ? math.ceil(ispeed) : math.floor(ispeed);
  obox.offsettop == itop ? clearinterval(obox.timer) : (obox.style.top = obox.offsettop + ispeed + "px");
 }, 30)
 }, 100)
 obox.onmouseover = function ()
 {
 this.style.width = 131 + "px";
 oline.style.display = "block";
 omenu.style.display = "none";
 };
 obox.onmouseout = function ()
 {
 this.style.width = '';
 oline.style.display = "none";
 omenu.style.display = "block";
 };
};
document.write("<style>img{border:0;}ul,li{padding:0;margin:0;}.box_lanrenzhijia {z-index:99;right:0;width:128px;height:195px;position:absolute;}.box_lanrenzhijia .press{right:0;width:36px;cursor:pointer;position:absolute;height:128px;}.box_lanrenzhijia .zzjs_net_list{left:0;width:131px;position:absolute;height:195px;background:url(images/20120321lanrenzhijia_1.gif) no-repeat left center;}.box_lanrenzhijia .zzjs_net_list ul{padding:37px 0 0 21px;}.box_lanrenzhijia .zzjs_net_list li{height:26px;margin-bottom:3px;_margin-bottom:3px; list-style-type:none;}</style><div class=\"box_lanrenzhijia\" id=\"qqbox_zzjs\"><div class=\"zzjs_net_list\" id=\"online_lanrenzhijia\" style=\"display:none;\"><ul><li><a href=\"http://wpa.qq.com/msgrd?v=1&uin=123456789&site=&menu=yes\"><img src=\"images/20111126lanrenzhijia_3.gif\" alt=\"一号客服\"></a></li><li><a href=\"http://wpa.qq.com/msgrd?v=1&uin=123456789&site=&menu=yes\"><img src=\"images/20111126lanrenzhijia_3.gif\" alt=\"二号客服\"></a></li><li><a href=\"http://wpa.qq.com/msgrd?v=1&uin=123456789&site=&menu=yes\"><img src=\"images/20111126lanrenzhijia_3.gif\" alt=\"三号客服\"></a></li><li><a href=\"http://wpa.qq.com/msgrd?v=1&uin=123456789&site=&menu=yes\"><img src=\"images/20111126lanrenzhijia_3.gif\" alt=\"四号客服\"></a></li><li><a href=\"http://wpa.qq.com/msgrd?v=1&uin=123456789&site=&menu=yes\"><img src=\"images/20111126lanrenzhijia_3.gif\" alt=\"五号客服\"></a></li></ul></div><div id=\"menu_zzjs_net\"><img src=\"images/20111126lanrenzhijia_4.gif\" class=\"press\" alt=\"在线客服\"></div></div>");
</script>
</body>
</html>
相关标签: QQ客服 悬浮