My laptop display resolution is 1280 x 800. When I query $(window).width() I get 1420 on Firefox while I get 1280 on Chrome. Why is Firefox showing me a window width greater than my screen resolution?
My laptop display resolution is 1280 x 800. When I query $(window).width() I get 1420 on Firefox while I get 1280 on Chrome. Why is Firefox showing me a window width greater than my screen resolution?
Share Improve this question asked Jan 26, 2013 at 3:07 irvyirvy 231 silver badge5 bronze badges 6-
Why are you using a library only to show the window dimensions? use:
screen.height
andscreen.width
for total dimensions, &screen.availHeight
andscreen.availWidth
for available dimensions. don't forget to check if the screen is zoomed. – Erick Ribeiro Commented Jan 26, 2013 at 3:10 - 1 You are querying the width of your browser window, not your physical screen size. The window width will change if you resize your browser, have more toolbars installed, etc. @Erik Riberio's suggestion below is what you are looking for. – Chris Barr Commented Jan 26, 2013 at 3:16
- @ChrisBarr - I think he is asking why the returned window width is greater than the screen width. And I don't think you can resize the window bigger than the screen. – Derek 朕會功夫 Commented Jan 26, 2013 at 3:36
- Ah, it totally missed that point! Sorry. – Chris Barr Commented Jan 26, 2013 at 3:41
- @Derek Yes, you can. just use the firefox Responsive Design View [Ctrl + Shift + M] and set the screen the size you want. – Erick Ribeiro Commented Jan 26, 2013 at 4:00
1 Answer
Reset to default 6Because your Firefox window is probably zoomed out.
Reset the zoom using one of the following:
- CTRL+0 (or CTRL+SHIFT+0 in some keyboard layouts)
- View (or ALT+V) > Zoom > Reset