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

前端 未结 3 1979
南方客
南方客 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:48

    I'm not sure about other browsers (tried it in Chrome and it didn't work), however FireFox will allow you to resize the window using:

    window.resizeTo(1280,1024);
    

    I have a bookmark with

    javascript:window.resizeTo(1280,1024);
    

    To resize the window to see what sites I develop look like at different resolutions.

提交回复
热议问题