본문으로 바로가기


결과 console 에서 확인하기



$(window).bind("resize", function() {
            console.log(">>> window resize");
            console.log("xxxxxxxxxxxx");
        });

        $(document).resize(function() {
            console.log(">>> document resize");
            console.log("------xxxxx----");
        });

        $("#btn_window_resize1").bind("click", function() {
            $(window).triggerHandler("resize");
            console.log("----------");
        });

        $("#btn_window_resize2").bind("click", function() {
            $(window).trigger("resize");
            console.log("----------");
        });

        $("#btn_document_resize1").bind("click", function() {
            $(document).triggerHandler("resize");
            console.log("----------");
        });

        $("#btn_document_resize2").bind("click", function() {
            $(document).trigger("resize");
            console.log("----------");
        });

See the Pen avJOZq by jaeheekim (@jaehee) on CodePen.