How do I find the virtual viewport/screen width using Javascript?

前端 未结 3 1806
无人及你
无人及你 2021-01-02 09:39

Is there a consistent way to determine the width of the screen and virtual viewport for mobile devices using Javascript? My target platforms are mobile Safari and Android\'

3条回答
  •  滥情空心
    2021-01-02 10:23

    You can find out the various viewport widths by accessing the following link on the device

    http://ipad.atwebpages.com/viewport.html

    This would work for both desktop and mobile browsers..

    Just to add, viewport is mainly useful for mobile devices only...

提交回复
热议问题