플라이아웃 레이어 값, 레이어 값

2705 단어 ASP.NET




      
 

    window.onload = function () {
        var oDemo = document.getElementById("demo");
        var oInput = document.getElementsByTagName("input")[0];
        var oDropbox = document.getElementById("dropbox");
        var aA = oDropbox.getElementsByTagName("a");
        var oClose = document.getElementsByTagName("em")[0];
        var i = 0;

        oInput.onclick = function (event) {
            oDropbox.style.display = "block";
            oDropbox.style.top = oDemo.offsetHeight + "px";
            oDropbox.style.left = oInput.offsetLeft + "px";
            oDropbox.style.width = oInput.clientWidth - 10 + "px";
            (event || window.event).cancelBubble = true;
        };

        for (i = 0; i < aA.length; i++) {
            aA[i].onclick = function (event) {
                oInput.value = this.innerHTML;
                (event || window.event).cancelBubble = true;
            };
        }

        oDropbox.onclick = function (event) {
            (event || window.event).cancelBubble = true;
        };

        document.onclick = oClose.onclick = function () {
            oDropbox.style.display = "none";
        };
    };

 
 

 

좋은 웹페이지 즐겨찾기