How can I obtain the browser width ?, JScriptcode // JS adjust the page height document. getElementById (& quot; leftMenu & quot;). style. height = window. screen. availHeight how to get the browser width
What is the specific usage?
------ Solution --------------------
JScript code
// Adjust the page height in JS document. getElementById ("leftMenu "). style. height = window. screen. availHeight; // The height of the menu navigation is equal to that of the browser. document. getElementById ("rightMessage "). style. height = window. screen. availHeight; // The height of the information on the right is equal to the height of the browser; document. getElementById ("leftMenu "). style. height = document. getElementById ("rightMessage "). style. height; // make the height of both sides equal; // when using the height percentage in the div, you must set that the parent element of the div is 100%
------ Solution --------------------
Html dom innerheight and innerwidth attributes
The read-only attribute declares the height and width of the document display area of the window, in pixels.
The width and height do not include the height of the menu bar, toolbar, and scroll bar.
IE does not support these attributes. It is replaced by the clientWidth and clientHeight attributes of document.doc umentElement or ducument. body (related to the IE version.
All these questions are answered by w3school. Don't be lazy. the lazy you miss, the more you miss.