Remove Safari Navigation Bar on iPhone when body overflow=hidden
I'd like to remove t开发者_StackOverflow中文版he Safari navigation bar when users visit my website from an iPhone.
I've tried
window.scrollTo(0, 1)
and am also using
<meta name="viewport" content="width=device-width; height=device-height; initial-scale=1.0; maximum-scale=1.0;">
in the header.
The problem is that the body tag of my website is set to overflow=hidden so the scroll command does nothing.
Does anyone know a solution?
The following code seems to work as a preliminary fix in portrait orientation.
<meta name="viewport" content="width=320; height=416; initial-scale=1.0; maximum-scale=1.0;">
精彩评论