admin管理员组文章数量:1026103
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
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
本文标签: javascriptFirefox and Chrome window widthheight showing differentlyStack Overflow
版权声明:本文标题:javascript - Firefox and Chrome window widthheight showing differently - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745632592a2160252.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论