浮动QQ在线客服代码,加入ASP网页中时,总出现:java script error Description:缺少。。还出现大片空白区域
发布网友
发布时间:2022-04-23 13:33
我来回答
共1个回答
热心网友
时间:2023-10-15 21:47
帮你运行了,没有出现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>
热心网友
时间:2023-10-15 21:47
帮你运行了,没有出现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>