You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Breaking change: .outerWidth() or .outerHeight() on window includes scrollbar width/height
Calls to $(window).width() return the "content width" which excludes any scrollbars that the browser has added if the content exceeds the height of the element. This is different from the width that CSS uses for media queries, which includes the width of the scrollbars. In order to provide a measure that is equivalent to the CSS media query concept of width, the $(window).outerWidth() method now returns the width including scrollbar width. This is equivalent to the DOM property window.innerWidth. The same applies for .outerHeight().
So it seems to me either the API documentation is obsolete about outerWidth() not being applicable to window, or the migration guide is wrong telling us to call outerWidth() on window to get its "CSS width". This is confusing.
There is the same trouble with .outerHeight() documentation.
The text was updated successfully, but these errors were encountered:
fredericDelaporte
changed the title
Contradiction outerWidth documentation on window and migration guide.
Contradiction about outerWidth documentation on window and migration guide.
Feb 17, 2022
fredericDelaporte
changed the title
Contradiction about outerWidth documentation on window and migration guide.
Contradiction about outerWidth documentation on window and migration guide
Feb 17, 2022
fredericDelaporte
changed the title
Contradiction about outerWidth documentation on window and migration guide
Contradiction about outerWidth on window between API documentation and migration guide
Feb 17, 2022
outerwidth()
documentation currently states:But the jQuery 3.0 migration guide states:
So it seems to me either the API documentation is obsolete about
outerWidth()
not being applicable towindow
, or the migration guide is wrong telling us to callouterWidth()
on window to get its "CSS width". This is confusing.There is the same trouble with
.outerHeight()
documentation.The text was updated successfully, but these errors were encountered: