Try to use screen.width
and screen.height
instead. Worked for me
When changing device metrics in chrome screen.availHeight doesn't change
-
12-01-2022 - |
質問
I wanted to test my webpage in chrome to see how it would look for different screen sizes. I changed the device metrics in the settings menu in developer tools window, but when I entered screen.availHeight and screen.availWidth into the console they showed my screen size not the changed sizes. These values are vital to my webpage, so I'm asking if there's any options to get the screen sizes for the changed device metrics?
解決
所属していません StackOverflow