js QQ客服悬浮效果实现代码
作者:bea
代码: <!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="te
代码:
<!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.</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>
猜你喜欢
您可能感兴趣的文章:
- node.js中的http.response.end方法使用说明
- node.js中的http.response.setHeader方法使用说明
- node.js中的http.response.removeHeader方法使用说明
- node.js中的http.request方法使用说明
- node.js中的buffer.copy方法使用说明
- node.js中的buffer.fill方法使用说明
- node.js中的buffer.length方法使用说明
- node.js中的buffer.toJSON方法使用说明
- node.js中的buffer.toString方法使用说明
- node.js中的buffer.Buffer.isEncoding方法使用说明
- node.js中的buffer.Buffer.isBuffer方法使用说明
- javascript实现单击和双击并存的方法
- Javascript数组与字典用法分析
- jQuery实现表单提交时判断的方法
- js实现iframe跨页面调用函数的方法
- javascript里使用php代码实例
- jQuery使用height()获取高度需要注意的地方
- js与css实现弹出层覆盖整个页面的方法
- jQuery对于显示和隐藏等常用状态的判断方法