"내타위키:대문"의 두 판 사이의 차이

8번째 줄: 8번째 줄:
 
<!--모든 파일은 저작권법에 의거하여 보호받는 저작물입니다.-->
 
<!--모든 파일은 저작권법에 의거하여 보호받는 저작물입니다.-->
 
<script>
 
<script>
    window.addEventListener('DOMContentLoaded', function() {
+
function adjustHeight() {
        function setVerticalHeight() {
+
  var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
            var windowHeight = window.innerHeight;
+
 
            var windowWidth = window.innerWidth;
+
  if (screenWidth <= 768) {
           
+
    document.getElementsByTagName('embed')[0].style.height = "calc(100vh + 10vh)";
            var verticalHeight = windowWidth <= 768 ? '100vh' : '130vh';
+
  } else {
            document.body.style.height = verticalHeight;
+
    document.getElementsByTagName('embed')[0].style.height = "calc(100vh + 30vh)";
        }
+
  }
       
+
}
        setVerticalHeight(); // 초기 로드 시 호출
+
 
       
+
window.onload = function() {
        window.addEventListener('resize', setVerticalHeight); // 윈도우 크기가 변경될 때마다 호출
+
  adjustHeight();
    });
+
};
 +
 
 +
window.addEventListener('resize', adjustHeight);
 
</script>
 
</script>
 
</body>
 
</body>
 
</html>
 
</html>

2023년 6월 9일 (금) 12:18 판

function adjustHeight() {

document.documentElement.clientWidth

if (screenWidth