Javascript set browser window size

前端 未结 2 1119
借酒劲吻你
借酒劲吻你 2020-12-09 10:37

What is the best way to set the size of the browser window when the page loads? I think this can be done in JavaScript. Please explain. Here is my code that is not working!<

2条回答
  •  孤街浪徒
    2020-12-09 11:11

    This should do the trick, setting the height and width to your desired dimensions.

    window.resizeTo(500,500)
    

    You could set it onload.

    
    

提交回复
热议问题