Gets the element width and height, the left margin on margin

jquery acquired width and height of all the elements (including the padding and margins):
  width () - Returns the width of the element.
  height () - Returns the element's height.
  The innerWidth () method returns the width of the element (including the margin).
  innerHeight, () method returns the height of the element (including the margin).
  the outerWidth () method returns the width of an element (including padding and border).
  outerHeight () method returns the height of the element (including padding and border).
  Return the document (HTML document) $ (document) .height () the height of the
  return window (browser viewport) $ (window) .height () height

Get a page element absolute X, Y coordinates can be used to offset ():
  var X-= $ ( '# divId') offset () Top;..
  Var the Y = $ ( '# divId') offset ().. left;

Obtaining a relative (parent element) position:
  .. X-var = $ ( '# divId') position () Top;
  var the Y = $ ( '# divId') position () left;..

 

window.innerWidth // remove the window width of the menu bar
window.innerHeight // remove window menu bar height
window.outerWidth // includes a menu bar window width
window.outerHeight // width of the window includes a menu bar
window.screen.height / height / computer screen
width window.screen.width // computer screen
window.screen.availHeight // computer screen available height
window.screen.availWidth // computer screen available width
window.screenTop // browser from the height of the screen
window.screenLeft // width of the browser screen distance
document.body.clientWidth // refers to the width of the element itself (including padding)
document.body.clientHeight // element itself refers to a height (including padding)
the document.body .clientLeft // child div width distance to the location of the content (i.e. border value) parent content area
document.body.clientTop // div child content to a height position from the parent content area (i.e. border value)
the document.body .offsetWidth // width specified element (including padding, border and content)
height document.body.offsetHeight // specified element (including padding, border, and Yung)
document.body.offsetTop // height of the parent element from
document.body.offsetLeft // width from the parent element
document.body.scrollWidth // get is the width of the document (when specified width is less than when the browser window , width) browser
document.body.scrollHeight // get is highly document (when the browser window height is less than the time specified, the height of the browser)
document.body.scrollTop // document is scrolled up time (ie the scroll bar to scroll up distance)
document.body.scrollLeft // document is scrolled to the right time (ie the scroll bar to scroll to the right distance)

Guess you like

Origin www.cnblogs.com/zjz666/p/11201157.html