JavaScript21 [JavaScript] window with, height cross Browser Window의 height, width를 가지고 올 때 Browser에 따라 다른 문법이 발생한다. 모든 브라우져에서 Window width, height을 가지고 올 수 있도록 한 코드이다. var myWidth = 0, myHeight = 0; if (typeof (window.innerWidth) == 'number') { //Chrome myWidth = window.innerWidth; myHeight = window.innerHeight; } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) { myWidth = document.doc.. 2013. 3. 25. 이전 1 ··· 3 4 5 6 다음