浏览我的帖子,在“管理菜单”那里,鼠标一经过,就弹出菜单。
我试了弄一下,但是OffsetTop这个位置总是不对!
请帮我看看怎么回事。CSDN的怎么不错乱位置?但是找不到他的Javascript控制?

解决方案 »

  1.   

    这个一般是一个DIV层 网上有这样菜单源码 lz在网上找下 代码都差不多
      

  2.   


    <html>
    <head>
    <title></title>
    <script type="text/javascript">
    function showMessage()
    {
        var div=document.getElementById("show");
        div.style.display="block";
    }
    function RemoveMessage()
    {
        var div=document.getElementById("show");
        div.style.display="none";
        
    }
    function prevent()
    {
    window.event.cancelBubble=true;
    }
    </script>
    </head>
    <body>
    <div>
        <div  style="border:1px solid #eee; heigth:100px; width:100px"  onmousemove="showMessage();" onmouseout="RemoveMessage();">test (click me)
            <div id="show"  style="border:1px solid #eee; heigth:100px; width:50px;display:none;">
                <div style="border:1px solid #eee; width:100px" onmouseout="prevent()" >test1</div>
                <div style="border:1px solid #eee; width:100px"  onmouseout="prevent()"  >test2</div>
                <div style="border:1px solid #eee; width:100px"  onmouseout="prevent()"  >test3</div>
                <div style="border:1px solid #eee; width:100px"  onmouseout="prevent()" >test4</div>
            </div>
        </div>
    </div>
    </body>
    </html>