小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

javascript設(shè)置DIV位置

 ShangShujie 2007-06-07

<div id="myDIV" style="z-index: 9999999; position: absolute; display: none; height: 210px;width350px">

<table>

            <tr style="height: 25px">

                <td class="ModiHead" align="center">

                    各階段版本信息</td>

            </tr>

            <tr style="height: 100%">

                <td>

                    <div style="visibility: inherit; overflow: auto; width: 100%; height: 100%">

                        <iframe frameborder="0" id="VersionFrame" src="" style="border: 0px; height: 100%;

                            width: 100%;"></iframe>

                    </div>

                </td>

            </tr>

            <tr style="height: 25px">

                <td class="ModiHead" align="center">

                    <a style="cursor: hand" onclick="javascript :document.all[‘myDIV‘].style.display=‘none‘;">

                        關(guān) 閉</a></td>

            </tr>

        </table>

 

 

/*顯示DIV*/

function showDIV()

{

    /*獲取當前鼠標左鍵按下后的位置,據(jù)此定義DIV顯示的位置*/

    var leftedge    = document.body.clientWidth-event.clientX;

    var bottomedge  = document.body.clientHeight-event.clientY;

   

    /*如果從鼠標位置到窗口右邊的空間小于DIV的寬度,就定位DIV的左坐標(Left)為當前鼠標位置向左一個DIV寬度*/

    if (leftedge < myDIV.offsetWidth)

    {

        myDIV.style.left = document.body.scrollLeft + event.clientX - myDIV.offsetWidth;

    }

    else

    {

        /*否則,就定位DIV的左坐標為當前鼠標位置*/

        myDIV.style.left = document.body.scrollLeft + event.clientX;

    }

   

   

    /*如果從鼠標位置到窗口下邊的空間小于DIV的高度,就定位DIV的上坐標(Top)為當前鼠標位置向上一個DIV高度*/

    if (bottomedge < myDIV.offsetHeight)

    {

        myDIV.style.top = document.body.scrollTop + event.clientY - myDIV.offsetHeight;

    }

    else

    {

        /*否則,就定位DIV的上坐標為當前鼠標位置*/

        myDIV.style.top = document.body.scrollTop + event.clientY;

    }

   

    /*設(shè)置DIV可見*/       

    myDIV.style.display = "block";

   

    return false;

}

 



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1565154

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約