jQuery UI resizable fire window resize event

后端 未结 5 672
庸人自扰
庸人自扰 2020-12-14 07:41

I have 2 events, one to detect window resize and other to detect the resizable stop of div.

But when I resize the div, in the console detect the window resize event.

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-14 08:04

    I think that actually the safest would be to do the following:

    $(window).bind('resize', function(event) {
        if (this == event.target) {
            console.log("resize");
        }
    });
    

提交回复
热议问题