The screen width is 1440, and displays 1456.
- Try self.outerWidth or self.innerWidth! If the result is the same, then JS has nothing to do with the problem! - Palmervan
- How did you determine the width of the screen? You could not identify it correctly. Usually, such a command produces the correct result. Those. set resolution. - Anton Mukhin
- The screen width is known to me. Does anyone not know what resolution is at his screen? If anything, you can look at the properties of the system. - komka
- Adding self does not change anything. - komka
- If you have Windows, then look at the resolution like this: desktop properties -> options -> screen resolution. I have 1360, and all browsers show it. Those. everything must be right. - Anton Mukhin
3 answers
outerWidth shows how much space is occupied in width (+ scroll bar). Use innerWidth
- innerWidth indicates the internal width of the window's content area. I know about innerWidth, I haven’t understood about outerWidth yet. - komka
The window.outerWidth property indicates the width of the browser window. You can check it in every browser and see, then it is different.
Apparently, the boarder of the window does not disappear when unfolded, but, as it were, remains outside the borders of the screen. This is indirectly indicated by the window.screenY and window.screenY properties, they are equal to -8. This explains the difference of 16 pixels in width, i.e. 16 pixels larger window than the screen resolution. If you take a screenshot of the window and then enlarge it in the graphical editor, you can see that the width of the window border in Windows 7 is just 8 pixels. For example, in the Chrome browser, the screenY and screenX properties are 0 and outerWidth is equal to the normal screen width, respectively.
- Why is it not written that
innerWidth
depends on the scale of the page, and as the scale decreases,outerWidth
becomes larger? - Alex78191
I am not familiar with this property, but apparently out means “out”, apparently showing how many spaces are actually occupied, did scrollbars appear?
- Scrollbars have nothing to do with it. How translated out does not matter. - komka