0

窗口更改时是否会触发跨浏览器窗口更改事件?我想要做的是在注入文本后检测窗口是否太宽:

HTML页面是空白的,然后我注入这个

$("body").append("cdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscscdscsdcsdcsdcsdcscs");`

页面太宽,我想触发一个事件,所以我尝试了这个,但它不起作用?

$(window).change(function () {
   alert('test');
    //is the window too wide then --------- do this

});

我怎样才能解决这个问题?

4

0 回答 0