Zooms out on a page when opening a menu

I use the Yahoo PureCSS library along with the sidebar plugin and it works fine in all browsers except mobile Safari. For some reason, it scales whenever a menu opens. This even happens in the documentation. I have no idea what could be causing this, but the temptation is to simply call it a browser error.

If necessary, I can build a JSFiddle.

+5
source share
2 answers

This question actually came down to the fact that it was the same as Overflow: Hidden, used to work on iPhone Safari? . I think Mobile Safari will zoom out to make room for the menu and content area when the user opens the menu, unless you do this on the wrapper element:

html, body { overflow-x: hidden; } 
0
source

The viewport meta tag does not contain a maximum scale value. If you update the viewport tag to the following, you will not get the same scaling every time the user clicks on the menu:

 <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> 

Note the addition of maximum-scale=1 to the end of the line. When this is added, the content will move instead of scaling. This has been tested on the PureCSS demo page for the Responsive side menu associated with the above.

+1
source

Source: https://habr.com/ru/post/1235593/


All Articles