scrollWidth(including non-viewable part) 與 clientWidth (only viewable part) 的差異在於 "viewable" or not
The scrollWidth property returns the entire width of an element in pixels, including padding, but not the border, scrollbar or margin.
The scrollWidth and scrollHeight properties return the entire height and width of an element, including the height and width that is not viewable (because of overflow).
The clientWidth property returns the viewable height of an element
in pixels, including padding, but not the border, scrollbar or margin.
The Element.scrollWidth read–only property returns either the width in pixels of the content of an element or the width of the element itself, whichever is greater. If the element is wider than its content area (for example, if there are scroll bars for scrolling through the content), the scrollWidth is larger than the clientWidth.
This property will round the value to an integer. If you need a fractional value, use element.getBoundingClientRect().
//=== scrollbar width
the scrollbar is a feature of the browser and not the web page self.
Measurement should be done dynamically.
A measurement with a scrollbar and a measurement without a scrollbar
will resolve into calculating the difference in width.
the width of the scrollbar is not standard and
varies from system to system and browser to browser