JS - scrollWidth、clientWidth、offsetWidth 區別

一、屬性說明: clientWidth = width(可見區域)+ padding - 滾動條寬度 offsetWidth = width(可見區域) + padding + border(若有滾動條寬,那就包含在裏面了) scrollWidth = width(自身實際長度,包括不可見區) + padding + border + margin 二、圖例:
相關文章
相關標籤/搜索