需要兼容各个浏览器的,很多不兼容!就是在浏览器窗口中一直随意浮动的那种!!希望大家帮帮忙哦!!

解决方案 »

  1.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>zell419</title>
    <style type="text/css">
    #head{position:fixed;_position:absolute;top:0px;_top:0px;_margin-top:expression(this.style.pixelHeight+document.documentElement.scrollTop)}
    #foot{position:fixed;_position:absolute;bottom:0px;_bottom:0px;_margin-top:expression(this.style.pixelHeight+document.documentElement.scrollTop)}
    </style>
    </head>
    <body style="height:5000px;">
    <div id="head">
    head
    </div>
    <div id="foot">
    foot
    </div>
    </body>
    </html>自己再调整下吧 。
      

  2.   


    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>www.lanrentuku.com</title>
    </head><body style="height:2000px;">
    <DIV id=img1 style="Z-INDEX: 100; LEFT: 2px; WIDTH: 59px; POSITION: absolute; TOP: 43px; HEIGHT: 61px;
     visibility: visible;"><a href="http://bbs.csdn.net/" target="_blank"><img src="http://avatar.profile.csdn.net/0/8/9/2_zell419.jpg" width="80" height="80" border="0"></a></DIV>
    <div align="center">
      <p>
        <SCRIPT language="javascript">
    var xPos = 300;
    var yPos = 200; 
    var step = 1;
    var delay = 20; 
    var height = 0;
    var Hoffset = 0;
    var Woffset = 0;
    var yon = 0;
    var xon = 0;
    var pause = true;
    var interval;
    img1.style.top = yPos;
    function changePos() 
    {
    width = document.body.clientWidth;
    height = document.body.clientHeight;
    Hoffset = img1.offsetHeight;
    Woffset = img1.offsetWidth;
    img1.style.left = xPos + document.body.scrollLeft;
    img1.style.top = yPos + document.body.scrollTop;
    if (yon) 
    {yPos = yPos + step;}
    else 
    {yPos = yPos - step;}
    if (yPos < 0) 
    {yon = 1;yPos = 0;}
    if (yPos >= (height - Hoffset)) 
    {yon = 0;yPos = (height - Hoffset);}
    if (xon) 
    {xPos = xPos + step;}
    else 
    {xPos = xPos - step;}
    if (xPos < 0) 
    {xon = 1;xPos = 0;}
    if (xPos >= (width - Woffset)) 
    {xon = 0;xPos = (width - Woffset);   }
    }

    function start()
     {
      img1.visibility = "visible";
    interval = setInterval('changePos()', delay);
    }
    function pause_resume() 
    {
    if(pause) 
    {
    clearInterval(interval);
    pause = false;}
    else 
    {
    interval = setInterval('changePos()',delay);
    pause = true; 
    }
    }
    start();
    </SCRIPT>
        </p>
    </div>
    </body>
    </html>ie6 ff chrome 可行 。
      

  3.   

    谢谢你了!再帮我,但上面的代码,ff,chrome都不行吧?不动啊,只有Ie6是可以的。
      

  4.   

    http://www.mayixueyuan.com/newshow.php?id=163这个不错啊,推荐!!