jQuery resize event not firing

前端 未结 7 1599
独厮守ぢ
独厮守ぢ 2021-01-11 09:58

For whatever reason the following:

$(function() {
  $(window).resize(function() {
    alert(\"resized!\");
  });
});

only fires an event wh

7条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-11 11:01

    Try this code.

    window.addEventListener("resize", function(){
        console.log('yeap worked for me!');
    })
    

提交回复
热议问题