使用手机查看页面时禁用初始缩放 [英] Disable initial zoom when viewing a page with mobile

查看:113
本文介绍了使用手机查看页面时禁用初始缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能禁用您使用智能手机查看网页时获得的初始缩放比例?

我不想禁用缩放,我只是就像用户在加载时查看整个页面(=> width),而不是一个小矩形。



我尝试了其他人提出的几种解决方案,但都没有他们为我工作。

解决方案

好吧,那很简单。我稍微调整了一下我从Google找到的解决方案。以下是唯一适用于我的代码:

 < meta name =viewportcontent =width = 960; user-可扩展= YES; /> 

它将默认缩放设置为960像素(更改为页面宽度),并仍允许用户放大/缩小。



编辑:它看起来像允许在默认的互联网浏览器(SGS4)上缩放,但它在使用谷歌浏览器时禁用缩放。


Is there a possbility to disable the initial zoom you get when viewing a page with your smartphone?

I don't want to disable zoom, I'd just like the user to view the entire page (=> width) when loading it and not just a small rectangle.

I've tried several solutions suggested by others but none of them worked for me.

解决方案

Okay well that was easy. I slightly tweaked a solution I found from Google. Here's the only code that worked for me:

<meta name="viewport" content="width=960; user-scalable=yes;" />

It sets the default zoom to 960px (change to the width of your page) and still allows the user to zoom in/out.

EDIT: It looks like it allows zoom on the default Internet Browser (SGS4) but it disables zoom when using Google Chrome.

这篇关于使用手机查看页面时禁用初始缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆