我正在使用移动 jquery 进行设计。我想调整我的网页/屏幕上的文本,以便它会在所有移动设备上自动调整。我怎么能激活这个?有什么想法吗?
最佳答案
设置 body 和 html 元素的宽度和高度以最大化页面。我知道,您还必须设置 html 元素很奇怪,但这就是生活。
html, body {
width:100%;
height:100%;
}
在您的标记中定义您的部分。
<section>...</section>
<section>...</section>
<section>...</section>
并调整您的部分大小以适应负载和调整页面大小时。像这样的东西:
function draw() {
var width = $(document).width();
var height = $(document).height();
$("section").width(width).height(height);
}
$(document).resize(draw);
$(draw);
关于javascript - 如何在更改窗口大小时调整网页页面上的文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13136875/