<div id="divStay" style="position: absolute">
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td valign="top" width="7%">
</td>
</tr>
</tbody>
</table>
</div>
<div id="divStayTopleft" style="position: absolute;">
<table cellspacing="0" cellpadding="0" width="109" border="0">
<tr>
<td colspan="3">
<a onclick="CloseQQ()" href="javascript:;">
<img height="34" src="qq_top.gif" width="109" usemap="#Map" border="0"></a>
</td>
</tr>
<tr>
<td width="6">
<img height="100" src="qq_life.gif" width="6">
</td>
<td valign="top" width="96">
<table cellspacing="0" cellpadding="0" width="90" align="center" border="0">
<tr>
<td height="30">
<table cellspacing="0" cellpadding="0" width="90" border="0">
<tr>
<td>
<img height="13" src="qq_ico1.gif" width="16"><span class="font_12"> <span style="font-size: 9pt">
客户服务</span></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellpadding="2">
<tr>
<td valign="bottom">
<a href="http://wpa.qq.com/msgrd?v=3&uin=2471718708&site=qq&menu=yes" target="_blank">
<img border="0" src="qq2.gif"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellpadding="2">
<tr>
<td valign="bottom">
<a href="http://wpa.qq.com/msgrd?v=3&uin=2471718708&site=qq&menu=yes" target="_blank">
<img border="0" src="qq1.gif"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</td>
<td width="7">
<img height="100" src="qq_right.gif" width="7">
</td>
</tr>
<tr>
<td colspan="3">
<img height="30" src="qq_bottom1.gif" width="109">
</td>
</tr>
<tr>
<td colspan="3">
<img height="33" src="qq_logo.gif" width="109">
</td>
</tr>
</table>
</div>function CloseQQ() {
divStayTopleft.style.display = "none";
return true;
}
function FloatTop() {
var startX1 = document.body.offsetWidth - 130, 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);
}
//alert(document.body.scrollLeft);
//alert(document.body.offsetWidth);
//ftlObj = ml("divStay",document.body.scrollLeft+document.body.offsetWidth-125,0);
//ftlObj1 = ml("divStayTopLeft",0,30);
ftlObj = ml("divStay", (document.body.scrollLeft + document.body.offsetWidth) - 130, 0);
ftlObj1 = ml("divStayTopLeft", (document.body.scrollLeft + document.body.offsetWidth) - 130, 30);
stayTopLeft();
}
FloatTop();错误信息是红色那一句,在遇到JScript 运行时中断-‘null’为空或不是对象
这个代码我要查到母版页里面,去掉母版页的头部DOCTYPE也试过了 不行,知道的麻烦看看。
<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td valign="top" width="7%">
</td>
</tr>
</tbody>
</table>
</div>
<div id="divStayTopleft" style="position: absolute;">
<table cellspacing="0" cellpadding="0" width="109" border="0">
<tr>
<td colspan="3">
<a onclick="CloseQQ()" href="javascript:;">
<img height="34" src="qq_top.gif" width="109" usemap="#Map" border="0"></a>
</td>
</tr>
<tr>
<td width="6">
<img height="100" src="qq_life.gif" width="6">
</td>
<td valign="top" width="96">
<table cellspacing="0" cellpadding="0" width="90" align="center" border="0">
<tr>
<td height="30">
<table cellspacing="0" cellpadding="0" width="90" border="0">
<tr>
<td>
<img height="13" src="qq_ico1.gif" width="16"><span class="font_12"> <span style="font-size: 9pt">
客户服务</span></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellpadding="2">
<tr>
<td valign="bottom">
<a href="http://wpa.qq.com/msgrd?v=3&uin=2471718708&site=qq&menu=yes" target="_blank">
<img border="0" src="qq2.gif"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellpadding="2">
<tr>
<td valign="bottom">
<a href="http://wpa.qq.com/msgrd?v=3&uin=2471718708&site=qq&menu=yes" target="_blank">
<img border="0" src="qq1.gif"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</td>
<td width="7">
<img height="100" src="qq_right.gif" width="7">
</td>
</tr>
<tr>
<td colspan="3">
<img height="30" src="qq_bottom1.gif" width="109">
</td>
</tr>
<tr>
<td colspan="3">
<img height="33" src="qq_logo.gif" width="109">
</td>
</tr>
</table>
</div>function CloseQQ() {
divStayTopleft.style.display = "none";
return true;
}
function FloatTop() {
var startX1 = document.body.offsetWidth - 130, 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);
}
//alert(document.body.scrollLeft);
//alert(document.body.offsetWidth);
//ftlObj = ml("divStay",document.body.scrollLeft+document.body.offsetWidth-125,0);
//ftlObj1 = ml("divStayTopLeft",0,30);
ftlObj = ml("divStay", (document.body.scrollLeft + document.body.offsetWidth) - 130, 0);
ftlObj1 = ml("divStayTopLeft", (document.body.scrollLeft + document.body.offsetWidth) - 130, 30);
stayTopLeft();
}
FloatTop();错误信息是红色那一句,在遇到JScript 运行时中断-‘null’为空或不是对象
这个代码我要查到母版页里面,去掉母版页的头部DOCTYPE也试过了 不行,知道的麻烦看看。
你alert一下el
然后在alert el.sp
看是哪一个为null
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
var distance = 200;
function RightScroll(){
var div = document.getElementById("divStayTopleft");
var Stop = document.documentElement.scrollTop;
var DTop = parseInt(div.offsetTop);
if(Stop+distance!=DTop){
var index = Math.ceil((Stop+distance-DTop)*0.1);
div.style.top=index+DTop+"px";
}
}
window.onload=function(){
window.setInterval(RightScroll,10)
}
</script>
</head>
<body style="height:1000px">
<form id="form1" runat="server">
<div id="aa" style="position:absolute;top:300px;">aa</div>
<div id="divStayTopleft" style="position: absolute;right:100px;top:200px;">
<table cellspacing="0" cellpadding="0" width="109" border="0">
<tr>
<td colspan="3">
<a onclick="CloseQQ()" href="javascript:;">
<img height="34" src="qq_top.gif" width="109" usemap="#Map" border="0"></a>
</td>
</tr>
<tr>
<td width="6">
<img height="100" src="qq_life.gif" width="6">
</td>
<td valign="top" width="96">
<table cellspacing="0" cellpadding="0" width="90" align="center" border="0">
<tr>
<td height="30">
<table cellspacing="0" cellpadding="0" width="90" border="0">
<tr>
<td>
<img height="13" src="qq_ico1.gif" width="16"><span class="font_12"> <span style="font-size: 9pt">
客户服务</span></span>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellpadding="2">
<tr>
<td valign="bottom">
<a href="http://wpa.qq.com/msgrd?v=3&uin=2471718708&site=qq&menu=yes" target="_blank">
<img border="0" src="qq2.gif"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%" cellpadding="2">
<tr>
<td valign="bottom">
<a href="http://wpa.qq.com/msgrd?v=3&uin=2471718708&site=qq&menu=yes" target="_blank">
<img border="0" src="qq1.gif"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
</table>
</td>
<td width="7">
<img height="100" src="qq_right.gif" width="7">
</td>
</tr>
<tr>
<td colspan="3">
<img height="30" src="qq_bottom1.gif" width="109">
</td>
</tr>
<tr>
<td colspan="3">
<img height="33" src="qq_logo.gif" width="109">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>