Three family methods in JS

document.body.clientWidth ==> BODY object width
document.body.clientHeight ==> BODY object height
document.documentElement.clientWidth ==> visible area width
document.documentElement.clientHeight ==> visible area height

Web visible area width: document.body.clientWidth
Web visible area height: document.body.clientHeight
Web visible area width: document.body.offsetWidth (including the width of the border)
Web visible area height: document.body.offsetHeight (including the border Height) The
full text of the webpage body width: document.body.scrollWidth The
full text height of the webpage body: document.body.scrollHeight
The height of the
webpage being scrolled: document.body.scrollTop The left of the webpage being scrolled: document.body.scrollLeft On the
body part of the webpage : Window.screenTop
webpage body part left: window.screenLeft
screen resolution height: window.screen.height
screen resolution width: window.screen.width
screen available working area height: window.screen.availHeight
screen available working area width : Window.screen.availWidth

// Some jQuery functions
(window).heigH T ( ) / / Liu view is when the window opening may be visual region domain high degree of  (window). height () // The height of the visible area of ​​the lower window of the browser <script type="math/tex" id="MathJax-Element-5">(window).height() //The current window of the browser can be View area height</script>(document).height() //The height of the lower window document in the browser
(document.bodand).heigH T ( ) / / Liu view is when the window opening text file B O D      andThe high degree of (document. body). height () // The height of the document body of the current window in the browser <script type="math/tex" id="MathJax-Element-6">(document.body).height() //Browse The height of the document body of the lower window of the browser</script>(document.body).outerHeight(true) //The total height of the document body of the lower window of the browser includes border padding margin
(window).widT H ( ) / / Liu view is when the window opening may be visual region domain width of  (window). width () // The width of the visible area of ​​the lower window of the browser <script type="math/tex" id="MathJax-Element-7">(window).width() //The current window of the browser can be Width of the viewing area</script>(document).width()//The width of the browser window document for the image
(document.bodand).widT H ( ) / / Liu view is when the window opening text file B O D      andThe high degree of (document. body). width () // The height of the document body of the current window in the browser <script type="math/tex" id="MathJax-Element-8">(document.body).width() //Browse The height of the document body of the current window of the browser</script>(document.body).outerWidth(true) //The total width of the document body of the current window of the browser includes border padding

HTML precise positioning: scrollLeft, scrollWidth, clientWidth, offsetWidth
scrollHeight: Get the scroll height of the object.
scrollLeft: Set or get the distance between the left edge of the object and the leftmost end of the currently visible content in the window
scrollTop: Set or get the distance between the top of the object and the top of the visible content in the window
scrollWidth: Get the scroll width of the object
offsetHeight: Get the height of the object relative to the layout or the parent coordinate specified by the parent coordinate offsetParent property
offsetLeft: Get the calculated left position of the
object relative to the layout or the parent coordinate specified by the offsetParent property offsetTop: Get the object relative to the layout or the offsetTop property The calculated top position of the specified parent coordinates
event.clientX the horizontal coordinate
relative to the document event.clientY the vertical coordinate relative to the document
event.offsetX the horizontal coordinate
relative to the container event.offsetY the vertical coordinate relative to the container
document.documentElement.scrollTop Vertical scrolling The value
event.clientX+document.documentElement.scrollTop relative to the horizontal coordinate of the document + the amount of scrolling in the vertical direction
Write picture description here

Guess you like

Origin blog.csdn.net/Smell_rookie/article/details/81941741