Dynamically resize div based on size of browser window

后端 未结 4 627
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 00:07

I\'m trying to figure out how to have a div dynamically resize, based on the size of the browser window. I\'ve set up a jsbin that illustrates my problem, here: http://jsbin

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-09 00:50

    You can try to bind to the resize event of the browser's window.

    For example:

    window.onresize = function() {
    //your code
    }
    

提交回复
热议问题