Can jQuery change `$(window).width()`?

前端 未结 3 1980
南方客
南方客 2020-12-19 12:22

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

$(\'#click\').click(function(){
   //menu 100px          


        
3条回答
  •  长情又很酷
    2020-12-19 12:51

    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

提交回复
热议问题