Home > Web Front-end > JS Tutorial > body text

Collection and sorting of container size, positioning, distance and other attributes in js_javascript skills

WBOY
Release: 2016-05-16 17:25:07
Original
1146 people have browsed it

element.clientWidth  //The actual width of the element, not counting the border

element.clientHeight   //The actual height of the element, not counting the border


element.offsetWidth  //Element The actual width of the element, plus the border

element.offsetHeight //The actual height of the element, plus the border


element.scrollWidth //There are many opinions about this, I tested it and it should be the element Actual width - width of the scroll bar

element.scrollHeight  //There are many opinions about this. I tested it and it should be the actual height of the element - height of the scroll bar


element.offsetLeft  // Relative The distance from the parent object, if position is set to relative under ie, it is the distance relative to the window

element.offsetTop // The distance relative to the parent object, if position is set to relative under ie, it is relative Distance from window


window.screenLeft  //Distance between the current window and the screen only for IE

window.screenX  //Distance between the current window and the screen not for IE


window.innerWidth //Current window size (inner) not for IE

window.outerWidth //Current window size (outer) not for IE


window.screen .width //Current screen resolution

window.screen.availWidth //Current screen available resolution

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!