注入文本后检测窗口是否太宽

时间:2012-11-19 09:42:59

标签: javascript jquery javascript-events

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

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

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

页面太宽,我想要一个事件发生,所以我尝试了这个,但它没有用?

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

});

我该如何解决这个问题?

0 个答案:

没有答案