漂浮在网页右侧的QQ在线客服代码? 1、怎么样修改以下代码,让其变为最靠右边2、如何插入到网页当中
</tr></table></div><scripttype="text/javascript">functionFloatTop(){varstartX1=docume...
</tr>
</table>
</div>
<script type="text/javascript">
function FloatTop()
{
var startX1 =document.body.offsetWidth-155 ,startY1 = 50;
var startX2 =0,startY2 = 195;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id,startX,startY)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
el.y = startY;
return el;
}
window.stayTopLeft=function()
{
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY1 - ftlObj.y)/8;
ftlObj1.y += (pY + startY2 - ftlObj1.y)/8;
ftlObj.sP(document.body.scrollLeft+document.body.offsetWidth-125, ftlObj.y);
ftlObj1.sP(ftlObj1.x, ftlObj1.y);
setTimeout("stayTopLeft()", 30);
}
ftlObj = ml("divStay",(document.body.scrollLeft+document.body.offsetWidth)/2+379,0);
ftlObj1 = ml("divStayTopLeft",(document.body.scrollLeft+document.body.offsetWidth)/2+379,30);
stayTopLeft();
}
FloatTop();
</script>
<!--End -->
<table><tr><td height="800"></td></tr></table>
</body>
</html> 展开
</table>
</div>
<script type="text/javascript">
function FloatTop()
{
var startX1 =document.body.offsetWidth-155 ,startY1 = 50;
var startX2 =0,startY2 = 195;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id,startX,startY)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
el.y = startY;
return el;
}
window.stayTopLeft=function()
{
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY1 - ftlObj.y)/8;
ftlObj1.y += (pY + startY2 - ftlObj1.y)/8;
ftlObj.sP(document.body.scrollLeft+document.body.offsetWidth-125, ftlObj.y);
ftlObj1.sP(ftlObj1.x, ftlObj1.y);
setTimeout("stayTopLeft()", 30);
}
ftlObj = ml("divStay",(document.body.scrollLeft+document.body.offsetWidth)/2+379,0);
ftlObj1 = ml("divStayTopLeft",(document.body.scrollLeft+document.body.offsetWidth)/2+379,30);
stayTopLeft();
}
FloatTop();
</script>
<!--End -->
<table><tr><td height="800"></td></tr></table>
</body>
</html> 展开
展开全部
帮你运行了,没有出现java script error Description的问题,有可能是你本地环境的问题,至于出现大片空白是因为你的表格标签乱了,没有对应!帮你调一下,代码:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>QQ在线客服</title>
<SCRIPT language=javascript>
function CloseQQ()
{
divStayTopleft.style.display="none";
return true;
}
function FloatTop()
{
var startX1 =document.body.offsetWidth-125 ,startY1 = 5;
var startX2 =0,startY2 = 95;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id,startX,startY)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
el.y = startY;
return el;
}
window.stayTopLeft=function()
{
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY1 - ftlObj.y)/8;
ftlObj1.y += (pY + startY2 - ftlObj1.y)/8;
ftlObj.sP(document.body.scrollLeft+document.body.offsetWidth-125, ftlObj.y);
ftlObj1.sP(ftlObj1.x, ftlObj1.y);
setTimeout("stayTopLeft()", 30);
}
ftlObj = ml("divStay",(document.body.scrollLeft+document.body.offsetWidth)/2+505,0);
ftlObj1 = ml("divStayTopLeft",(document.body.scrollLeft+document.body.offsetWidth)/2+509,30);
stayTopLeft();
}
</SCRIPT>
</head>
<body>
<DIV id=divStay style="POSITION:absolute"></DIV>
</DIV>
<SCRIPT language=javascript>
function picsize(obj,MaxWidth){
img=new Image();
img.src=obj.src;
if (img.width>MaxWidth)
{
return MaxWidth;
}
else
{
return img.width;
}
}
function CloseQQ()
{
divStayTopleft.style.display="none";
return true;
}
var online= new Array();
</SCRIPT>
<div id="divStayTopleft" style="POSITION: absolute; left: 267px; top: 34px;">
<table cellspacing="0" cellpadding="0" width="109" border="0">
<tr>
<td colspan="3">
<a onClick="CloseQQ()" href="javascript:;" shape="circle" coords="91,16,12">
<img height="34" src="QQ3.png" width="109" usemap="#Map" border="0"></a></td>
</tr>
<tr>
<td width="6"><img height="250" src="QQ2.png" width="6"></td>
<td valign="top" width="96" background="sto/qq_bg.gif">
</td></tr></table>
</div>
中间省略。。。。。。。。。
FloatTop();
<!--End -->
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="800"> </td>
</tr>
</table>
<script type="text/javascript">FloatTop();</script>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>QQ在线客服</title>
<SCRIPT language=javascript>
function CloseQQ()
{
divStayTopleft.style.display="none";
return true;
}
function FloatTop()
{
var startX1 =document.body.offsetWidth-125 ,startY1 = 5;
var startX2 =0,startY2 = 95;
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function ml(id,startX,startY)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
el.x = startX;
el.y = startY;
return el;
}
window.stayTopLeft=function()
{
var pY = ns ? pageYOffset : document.body.scrollTop;
ftlObj.y += (pY + startY1 - ftlObj.y)/8;
ftlObj1.y += (pY + startY2 - ftlObj1.y)/8;
ftlObj.sP(document.body.scrollLeft+document.body.offsetWidth-125, ftlObj.y);
ftlObj1.sP(ftlObj1.x, ftlObj1.y);
setTimeout("stayTopLeft()", 30);
}
ftlObj = ml("divStay",(document.body.scrollLeft+document.body.offsetWidth)/2+505,0);
ftlObj1 = ml("divStayTopLeft",(document.body.scrollLeft+document.body.offsetWidth)/2+509,30);
stayTopLeft();
}
</SCRIPT>
</head>
<body>
<DIV id=divStay style="POSITION:absolute"></DIV>
</DIV>
<SCRIPT language=javascript>
function picsize(obj,MaxWidth){
img=new Image();
img.src=obj.src;
if (img.width>MaxWidth)
{
return MaxWidth;
}
else
{
return img.width;
}
}
function CloseQQ()
{
divStayTopleft.style.display="none";
return true;
}
var online= new Array();
</SCRIPT>
<div id="divStayTopleft" style="POSITION: absolute; left: 267px; top: 34px;">
<table cellspacing="0" cellpadding="0" width="109" border="0">
<tr>
<td colspan="3">
<a onClick="CloseQQ()" href="javascript:;" shape="circle" coords="91,16,12">
<img height="34" src="QQ3.png" width="109" usemap="#Map" border="0"></a></td>
</tr>
<tr>
<td width="6"><img height="250" src="QQ2.png" width="6"></td>
<td valign="top" width="96" background="sto/qq_bg.gif">
</td></tr></table>
</div>
中间省略。。。。。。。。。
FloatTop();
<!--End -->
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="800"> </td>
</tr>
</table>
<script type="text/javascript">FloatTop();</script>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询