728x90 300x250 SMALL resize2 윈도우 리사이즈 이벤트 처리 resize resize 이벤트는 윈도우 사이즈가 변경될때 window 객체에서 발생하는 이벤트이다. $(window).on("resize",function(e){ }); 윈도우 크기가 변경될 경우 현재 윈도우 크기 콘솔창에 나타내기 $(window).on("resize",function(e){ var w = window.outerWidth; var h = window.outerHeight; console.log(`width=${w}, height=${h}`) }); 2023. 4. 16. 윈도우 크기 변경 (resize) 될 때마다 크기 정보 가져오기 (document).ready(function(){ $(window).on("resize",function(){ size(); }) size(); }) function size(){ var w = $(document).width(); var h = $(document).height(); $("#info").html(`width = ${w}, height = ${h}`); } 2023. 4. 12. 이전 1 다음 728x90 반응형 LIST