Skip to content

use visualViewport's value for $(window).height()  #4161

Closed
@gulping

Description

@gulping

Description

In recent Chrome,window.visualViewport is available to get window size.
Window.visualViewport - Web APIs | MDN

This is the only value that can follow the address bar shrinking on mobile browsers.
window.innerHeight, document.documentElement.clientHeight don't work well.

So consider to use window.visualViewport.height for $(window).height() if possible.


(Ditto for width.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions