jsfx_floattopdiv兼容火狐滚动特效
来源:
互联网
日期:2013-1-1
Tc711Com提示:下面的是一段在线客服代码, 在火狐下不能滚动, 本文章将给出终极解决方法.
|
<script type="text/javascript">
if (typeof doyoo == 'undefined' || !doyoo) {
var d_genId = function() {
var id = '',
ids = '0123456789abcdef';
for (var i = 0; i < 34; i++) {
id += ids.charAt(Math.floor(Math.random() * 16));
}
return id;
};
var doyoo = {
env: {
secure: false,
mon: 'http://m3.talk99.cn/monitor',
chat: 'http://chat1.talk99.cn/chat',
file: 'http://static.soperson.com/111227',
compId: 10001441,
confId: 10001571,
vId: d_genId(),
lang: '',
fixFlash: 1,
subComp: 0
},
monParam: {
index: -1,
style: {
mbg: 'http://www.tc711.com/tan1.jpg',
mh: 142,
mw: 350,
elepos: '7 9 200 20 114 40 226 56 120 20 85 28 220 20 84 28 0 0 0 0',
mbabg: 'http://www.tc711.com/jieshou.jpg',
mbdbg: 'http://www.tc711.com/jujue.jpg',
mbpbg: ''
},
title: '\u4e2d\u5c71\u5361\u8428\u5c14\u676f\u4e1a\u6709\u9650\u516c\u53f8\u6b22\u8fce\u60a8\uff01',
text: '\u5c0a\u656c\u7684\u5ba2\u6237\u60a8\u597d\uff0c\u6b22\u8fce\u5149\u4e34\u5361\u8428\u5c14\u676f\u4e1a\uff01\u70b9\u51fb\u201c\u73b0\u5728\u54a8\u8be2\u201d\u5373\u53ef\u4e0e\u6211\u5bf9\u8bdd\u3002 ',
auto: 5,
group: '10001479',
start: '00:00',
end: '24:00',
mask: false,
status: false,
fx: 0,
mini: 1,
pos: 2,
offShow: 1,
loop: 0,
autoHide: 0,
hidePanel: 0,
miniStyle: 1,
showPhone: 0,
monHideStatus: [0, 1, 0],
monShowOnly: ''
},
sniffer: {
ids: '53.gif,kefu_01.gif,\u5728\u7ebf\u5ba2\u670d,kefu_05.gif',
gids: '10001479,10001479,10001479,10001479'
}
};
document.write('');
document.write('');
document.write('');
document.write('');
}
</script>
<!--下面是网站右边滑动客服代码-->
<div id="divStayTopright" style="position:absolute; z-index:999">
<!--下面是匿名交谈的代码-->
<img border=0 src="images/kefu_01.gif">
</a>
<br>
<!--下面是qq的代码-->
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=187367103&site=qq&menu=yes">
<img src="images/kefu_02.gif" border="0" align="absmiddle">
</a>
<br>
<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=1821804963&site=qq&menu=yes">
<img src="images/kefu_03.gif" border="0"
align="absmiddle">
</a>
<br>
<!--下面返回顶部的代码-->
<a href="#top">
<img border="0" src="images/kefu_04.gif">
</a>
<br>
</div>
<SCRIPT type=text/javascript>
var verticalpos = "frombottom"
function JSFX_FloatTopDiv() {
var startX = 0,
startY = 580;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id) {
var el = d.getElementById ? d.getElementById(id) : d.all ? d.all[id] : d.divs[id];
if (d.divs) el.style = el;
el.sP = function(x, y) {
this.style.right = x;
this.style.top = y;
};
el.x = startX;
if (verticalpos == "fromtop") el.y = startY;
else {
el.y = ns ? pageYOffset + innerHeight: document.documentElement.scrollTop + document.documentElement.clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopright = function() {
if (verticalpos == "fromtop") {
var pY = ns ? pageYOffset: document.documentElement.scrollTop;
ftlObj.y += (pY + startY - ftlObj.y) / 8;
} else {
var pY = ns ? pageYOffset + innerHeight: document.documentElement.scrollTop + document.documentElement.clientHeight;
ftlObj.y += (pY - startY - ftlObj.y) / 8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopright()", 10);
}
ftlObj = ml("divStayTopright");
stayTopright();
}
JSFX_FloatTopDiv();
</SCRIPT>
//这个在线客服在火狐下不能滚不, 解决方案是:
1 if (verticalpos == "fromtop") {
2 var pY = ns ? pageYOffset: document.documentElement.scrollTop;
3 ftlObj.y += (pY + startY - ftlObj.y) / 8;
4 } else {
5 var pY = ns ? pageYOffset + innerHeight:
document.documentElement.scrollTop +
document.documentElement.clientHeight;
6 ftlObj.y += (pY - startY - ftlObj.y) / 8;
7 }
第6行后加一句: ftlObj.style.top=ftlObj.y+"px";
详情解决办法: http://bbs.tc711.com/thread-7263-1-1.html
更多的jsfx_floattopdiv兼容火狐滚动特效请到论坛查看: http://BBS.TC711.COM
【 双击滚屏 】 【 评论 】 【 收藏 】 【 打印 】 【 关闭 】
来源:
互联网
日期:2013-1-1
|
|
|