We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用ViewPort对移动端页面进行缩放 view主要用于移动端屏幕的缩放与宽度匹配,一般都写定死代码如下
<meta name="viewport" content=" width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
meta的这段代码可以改变缩放比,可以实现类似于放大镜效果,而且不改变浏览器的渲染模式, 非常适用于屏幕大,但是分辨率较低的移动显示设备,注意必须是移动端显示设备,桌面端对此标签无效。
比如我以1290来制定基准,不论当前屏幕分辨率为多少,都得到1290px的渲染效果
function setViewport () { var vp = $("meta[name=viewport]")[0]; var sw = $(window).width(); var stand = 1290; // var sh = window.innerHeight; // var height = 0; var sca = sw / stand; vp.content = "width=device-width, initial-scale="+ sca +", maximum-scale="+ sca +", minimum-scale="+ sca +", user-scalable=no"; };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ViewPort 👍
由于目前项目所在电视机屏幕为960*540像素,高度严重不足,导致画面渲染异常
真实模拟模拟大分辨率屏幕
实现代码
电视机浏览器显示方式切换按钮
The text was updated successfully, but these errors were encountered: