In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
Today, the editor will share with you the relevant knowledge points about the relevant attributes of the location in js, the content is detailed, and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look.
I. Dom object attribute-distance
1.offsetLeft & & offsetTop
OffsetLeft / / returns the distance from the left boundary of the current element to the left boundary of its parent element (offsetParent) [read-only] offsetTop / / returns the distance from the upper boundary of the current element to the upper boundary of its parent element (offsetParent) [read-only]
2. OffsetWidth & & offsetHeight
OffsetWidth / / returns the width of the element, * * contains the border * * [read-only] offsetHeight / / returns the height of the element, * * contains the border * * [read-only] T
3.clientWidth & & clientHeight
ClientWidth / / returns the height of the element, * * [does not] include the border * * clientHeight / / returns the width of the element, * * [does not] include the border * *
4.scrollTop & & scrollLeft
ScrollTop / / returns the vertical position of the scroll bar of the matching element scrollLeft / / returns the horizontal position of the scroll bar of the matching element
5.offsetParent
OffsetParent / / returns the offset container of the element, that is, the parent container corresponding to the current container offset. Bom object attribute-distance
1.width & & height
Screen.width / / width of computer screen screen.height / / height of computer screen
2.availWidth & & availHeight
Screen.availWidth / / width of computer screen [minus window sidebar] screen.availHeight / / height of computer screen [minus window sidebar] .window object attribute-distance
2.innerWidth & & innerHeight
Inner width of window.innerWidth / / browser window window.innerHeight / / Inner height of browser window IV. Event object properties-coordinates
1.offsetX & & offsetY
OffsetX / / relative to the Abscissa of the element offsetY / / relative to the ordinate of the element
2.clientX & & clientY
ClientX / / relative to the Abscissa of the browser window clientY / / relative to the ordinate of the browser window
3.pageX & & pageY
PageX / / relative to the Abscissa of the page pageY / / relative to the ordinate of the page
4.screenX & & screenY
ScreenX / / relative to the Abscissa of the computer screen screenY / / relative to the ordinate of the computer screen
[you can understand the coordinates with the diagram below]
These are all the contents of the article "what are the relevant attributes of locations in js?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.