jQuery get width and height of various pages

Gets the height of the browser display area (viewable area) are:

$(window).height();   

Get the width of the browser display area (visible area) of:
$(window).width();   
Obtaining Documentation height of the page   
$(document).height();   
Obtaining Documentation width of the page:
$(document).width(); 
The current browser window document body height:  
$(document.body).height();
The current browser window width of the document body: 
$(document.body).width();
Get the scroll bar to the top of the vertical height (i.e., height of the web is rolled up)  
$(document).scrollTop();   
Get the width of the vertical scroll bar to the left:
$(document).scrollLeft(); 
Gets or sets the width of the element:
$(obj).width();
Gets or sets the height of the element:
$(obj).height();
On the border of an element to the top of the body most distance:
. Obj.offset () top; (in the case of the element comprising the scroll bar element-free)
The left margin of an element to the leftmost distance body:
obj.offset () left;. (In the case of the element comprising the scroll bar element-free)
Returns the upper boundary of the current element to offset its upper boundary element comprising:
obj.offset (). top (in the case of the element comprising the scroll bar elements containing)
Returns the left boundary of the current element to its left edge offset element comprising:
obj.offset (). left (in the case of the element comprising the scroll bar elements containing)

Guess you like

Origin www.cnblogs.com/venom95/p/11199178.html