Questions tagged «offsetheight»

4
什么是offsetHeight,clientHeight,scrollHeight?
想解释之间有什么区别的offsetHeight,clientHeight和scrollHeight或offsetWidth,clientWidth和scrollWidth? 在客户端上工作之前,必须先了解这一区别。否则,他们将有一半的生命将花费在修复UI上。 小提琴或下面的内联: function whatis(propType) { var mainDiv = document.getElementById("MainDIV"); if (window.sampleDiv == null) { var div = document.createElement("div"); window.sampleDiv = div; } div = window.sampleDiv; var propTypeWidth = propType.toLowerCase() + "Width"; var propTypeHeight = propType + "Height"; var computedStyle = window.getComputedStyle(mainDiv, null); var borderLeftWidth = computedStyle.getPropertyValue("border-left-width"); var borderTopWidth = …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.