js to get the height of the visible area of the web page screen

  1. document.body.clientWidth ==> BODY object width  
  2. document.body.clientHeight ==> BODY object height  
  3. document.documentElement.clientWidth ==> visible area width  
  4. document.documentElement.clientHeight ==> visible area height  
  5.   
  6. The width of the visible area of ​​the web page: document.body.clientWidth  
  7. The visible area of ​​the web page is high: document.body.clientHeight  
  8. The width of the visible area of ​​the web page: document.body.offsetWidth (including the width of the border)  
  9. The height of the visible area of ​​the web page: document.body.offsetHeight (including the height of the edge)  
  10. The full text width of the page body: document.body.scrollWidth  
  11. The height of the full text of the page body: document.body.scrollHeight  
  12. The height of the page being scrolled: document.body.scrollTop  
  13. The left side of the page is scrolled: document.body.scrollLeft  
  14. On the body of the page: window.screenTop  
  15. The left part of the body of the webpage: window.screenLeft  
  16. The height of the screen resolution: window.screen.height  
  17. The width of the screen resolution: window.screen.width  
  18. Screen available workspace height: window.screen.availHeight  
  19. Screen available workspace width: window.screen.availWidth  
  20.   
  21. // some jQuery functions  
  22. $(window).height()  //The height of the visible area of ​​the lower window in the browser   
  23. $(document).height()    //The height of the window document under the browser   
  24. $(document.body).height()      //The height of the window document body under the browser   
  25. $(document.body).outerHeight( true ) //The total height of the body of the lower window document in the browser, including border padding margin   
  26. $(window).width()  //The width of the visible area of ​​the lower window in the browser   
  27. $(document).width() //The width of the window document under the browser is for the image width   
  28. $(document.body).width()      //The height of the body of the window document under the browser   
  29. $(document.body).outerWidth( true ) //The total width of the body of the window document in the browser, including border padding  
  30.   
  31. HTML precise positioning: scrollLeft, scrollWidth, clientWidth, offsetWidth   
  32. scrollHeight: Get the scroll height of the object.   
  33. scrollLeft: Sets or gets the distance between the left edge of the object and the leftmost edge of the currently visible content in the window   
  34. scrollTop: Sets or gets the distance between the top of the object and the top of the visible content in the window   
  35. scrollWidth: Get the scroll width of the object   
  36. offsetHeight: Get the height of the object relative to the layout or the parent coordinate specified by the parent coordinate offsetParent property   
  37. offsetLeft: Gets the calculated left position of the object relative to the canvas or parent coordinates specified by the offsetParent property   
  38. offsetTop: Gets the calculated top position of the object relative to the canvas or parent coordinates specified by the offsetTop property   
  39. event.clientX is the horizontal coordinate relative to the document   
  40. event.clientY vertical coordinate relative to the document   
  41. event.offsetX is the horizontal coordinate relative to the container   
  42. event.offsetY vertical coordinate relative to the container   
  43. document.documentElement.scrollTop vertical scroll value   
  44. event.clientX+document.documentElement.scrollTop relative to the horizontal coordinates of the document + the amount of scrolling in the vertical direction

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325544278&siteId=291194637