problem arises: I use js to dynamically set the width of a box, the parent box is width:100%, but js always deviates from the actual value when using offsetWidth to get the value of the parent box. As shown in figure
problem arises: I use js to dynamically set the width of a box, the parent box is width:100%, but js always deviates from the actual value when using offsetWidth to get the value of the parent box. As shown in figure
I have the same situation. I measured the width of the scroll bar and found that the 17 pixels with deviation was the width of the scroll bar
.