javascript中獲取dom元素的高度和寬度

本身的寬高——width/height+padding • clientWidth • clientHeight 本身的寬高——width/height+padding+border • offsetWidth • offsetHeight 距離左側和上部的距離,相對於窗口 • offsetLeft • offsetTop 獲取可以滾動的寬高(不包括border)如果內容寬高比本身小,該值爲本身寬
相關文章
相關標籤/搜索