本帖最后由 todown 于 2011-06-08 11:37:15 编辑

解决方案 »

  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">
                #right{position:fixed;_position:absolute;top:0px;_top:0px;right:100px;_right:100px; _margin-top:expression(this.style.pixelHeight+document.documentElement.scrollTop)} 
            </style> 
        </head> 
        <body style="height:5000px;"> 
        <div id="right"># right </div>
        </body> 
    </html>这样 ?
    自己去通过left top  left bottom 调整具体为主 。
      

  2.   

    不是这样的,你这个是默认浮动的,我要的是DIV开始固定在一个位置,当下拉条下拉的高度超过这个DIV 1px的时候,这个DIV变浮动。
    要用JS来写的,监控IE下拉条触发事件。大体原理我知道,但不知道怎么写。
      

  3.   


    <!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></title>
        <script src="../demo/jquery-1.3.2.min.js" type="text/javascript"></script>
    </head>
    <body style="height:2800px;">
    *DIV开始固定在一个位置,当下拉条下拉的高度超过这个DIV 1px的时候,这个DIV变浮动*
    <div id="top" style="position:fixed; top:50px; left:50px;">
        
    </div>
    <div id="pan" style="width:160px; height:300px; border:dashed 1px black; position:absolute; right:0px; top:300px;">
        
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            window.onscroll = function () {
                var t = document.documentElement.scrollTop;
                document.getElementById("top").innerHTML = t;            if (t > 301) {
                    $("#pan").css({ "position": "fixed", "top": "0" });
                }
                else {
                    $("#pan").css({ "position": "absolute", "top": "300" });
                }        }
        });
    </script>
    </body>
    </html>