jQuery可以更改`$(window).width()`吗? [英] Can jQuery change `$(window).width()`?

查看:79
本文介绍了jQuery可以更改`$(window).width()`吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以通过jQuery更改$(window).width(),这样的事情是可能的:

Is it possible to change $(window).width() via jQuery, so that something like this is possible:

$('#click').click(function(){
   //menu 100px with $(window).width();
});

推荐答案

不,不是.底层DOM元素本身不支持修改浏览器窗口的宽度.可以更改内容的尺寸(outerWidth/innerWidth)区域.但是,我认为这不会影响您似乎想要实现的窗口大小

No it's not. The underlying DOM element itself doesn't support modifying the width of the browser window. It is possible to change the dimensions of the content (outerWidth / innerWidth) area. However I don't believe this has an affect on the size of the window which is what you seem to want to achieve

这篇关于jQuery可以更改`$(window).width()`吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆