下面的代码单独运行没问题,但是<!--#Include File="Include/QQ_line1.asp"-->这样插到页面中,上下拉动滚动条是,QQ在线也不能上下移动了。而且在google和IE中都不能定位到右侧,而是停在左上方。(360中可定位)。求解!谢谢!<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>
<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">
<TABLE cellSpacing=0 cellPadding=0 width=109 border=0>
  <TBODY>
  <TR>
    <TD colSpan=3><A onclick=CloseQQ() href="javascript:;" shape=circle 
      coords=91,16,12><IMG height=34 src="images/qq_top.gif" width=109 
      useMap=#Map border=0></A></TD></TR>
  <TR>
    <TD width=6><IMG height=120 src="images/qq_life.gif" width=6></TD>
    <TD vAlign=top width=96 background="">
      <TABLE cellSpacing=0 cellPadding=0 width=90 align=center border=0>
        <TBODY>
        <TR>
          <TD height=23>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top width=10 height=23>&nbsp;
  </TD>
                <TD>                  
<SCRIPT>document.write("<a href=http://wpa.qq.com/msgrd?V=1&#38;Uin=1842707868&#38;Site=美国加拿大温哥华国际征婚网温哥华单身社区&#38;Menu=yes target=blank><img alt=1号在线客服 src=http://wpa.qq.com/pa?p=1:1842707868:7 border=0/></a>");</SCRIPT>
</TD>
</TR>
</TBODY>
 </TABLE></TD></TR>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top width=10 height=23>&nbsp;
  </TD>
                <TD>                  
<SCRIPT>document.write("<a href=http://wpa.qq.com/msgrd?V=1&#38;Uin=1908155048&#38;Site=美国加拿大温哥华国际征婚网温哥华单身社区&#38;Menu=yes target=blank><img alt=2号在线客服 src=http://wpa.qq.com/pa?p=1:1908155048:7 border=0/></a>");</SCRIPT>
</TD>
</TR>
</TBODY>
 </TABLE></TD></TR>
        <TR>
          <TD></TD></TR>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top width=10 height=23>&nbsp;
  </TD>
                <TD>                  
<SCRIPT>document.write("<a href=http://wpa.qq.com/msgrd?V=1&#38;Uin=1958652598&#38;Site=美国加拿大温哥华国际征婚网温哥华单身社区&#38;Menu=yes target=blank><img alt=3号在线客服 src=http://wpa.qq.com/pa?p=1:1908155048:7 border=0/></a>");</SCRIPT>
</TD>
</TR>
</TBODY>
 </TABLE>
 </TD>
</TR>
        <TR>
          <TD>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD vAlign=top width=10 height=23>&nbsp;
  </TD>
                <TD>                  
<SCRIPT>document.write("<a href=http://wpa.qq.com/msgrd?V=1&#38;Uin=2354456333&#38;Site=美国加拿大温哥华国际征婚网温哥华单身社区&#38;Menu=yes target=blank><img alt=4号在线客服 src=http://wpa.qq.com/pa?p=1:2354456333:7 border=0/></a>");</SCRIPT>
</TD>
</TR>
</TBODY>
 </TABLE>
 </TD>
</TR>
<TR>
          <TD></TD></TR></TBODY></TABLE></TD>
    <TD width=7><IMG height=120 src="images/qq_right.gif" width=7></TD></TR>
  <TR>
    <TD colSpan=3><IMG height=30 src="images/qq_bottom1.gif" 
  width=109></TD></TR>
  <TR>
    <TD colSpan=3><IMG height=33 src="images/qq_logo.gif" 
  width=109></TD></TR></TBODY></TABLE></DIV>
<SCRIPT type=text/javascript>
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-125,0);
//  ftlObj1 = ml("divStayTopLeft",0,30);
 ftlObj = ml("divStay",(document.body.scrollLeft+document.body.offsetWidth)/2+379,0);
 ftlObj1 = ml("divStayTopLeft",(document.body.scrollLeft+document.body.offsetWidth)/2+510,30);
 stayTopLeft();
}
FloatTop();
</SCRIPT>

解决方案 »

  1.   

    楼主 是不是想实现这样的效果?
    把你要显示的内容 放到
    <div id="test">这里</div>
    <!doctype html>
    <html>
    <head>
    <meta charset="gb2312" />
    <style>
    body { height:1850px; }
    div {
    width:100px; height:100px; border:1px solid red;
    position:absolute; bottom:10px; right:10px;
    }
    </style>
    </head>
    <body>
    <div id="test">123</div>
    <script>
    function $(o){return document.getElementById(o)}

    window.onscroll = function(){
    $('test').style.top = document.documentElement.clientHeight + (document.documentElement.scrollTop || document.body.scrollTop) - 110 +'px' 
    }
    </script>
    </body>
    </html>
      

  2.   

    calmcrime的回复是我见到目前为止最简洁的一个实现该功能的程序。谢谢