to:sync
This commit is contained in:
parent
b3ec0d8073
commit
679576df2b
@ -32,15 +32,18 @@ define(function (require, exports, module) {
|
||||
}
|
||||
|
||||
|
||||
let dpr = getDpr();
|
||||
//set 1rem = curClientW / designWidth (支持响应式)
|
||||
let nowFrontSize = curClientW / designWidth + 'px';
|
||||
let nowFrontSize = '1px';
|
||||
if (ctx.isTablet || ctx.isMobile || ctx.isIOS || ctx.isAndroid) {
|
||||
let dpr = getDpr();
|
||||
curDoc.style.fontSize = dpr * nowFrontSize;
|
||||
nowFrontSize = (curClientW / designWidth) * dpr + 'px';
|
||||
} else {
|
||||
curDoc.style.fontSize = nowFrontSize;
|
||||
nowFrontSize = (curClientW / designWidth) + 'px';
|
||||
}
|
||||
|
||||
// curDoc.style.fontSize = dpr * nowFrontSize;
|
||||
curDoc.style.fontSize = nowFrontSize;
|
||||
|
||||
console.log("curClientW :", curClientW, "designWidth: ", designWidth, "-> ", nowFrontSize);
|
||||
let testDiv = document.getElementById("testDevice");
|
||||
testDiv.innerText += "\ncurClientW: " + curClientW;
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
<header>
|
||||
<!-- 顶部 -->
|
||||
<div id="head_top" style="font-size: 12rem">
|
||||
<div id="head_top" style="font-size: 12px">
|
||||
<div style="width:20%">测试</div>
|
||||
<div style="width: 60%"></div>
|
||||
<div style="width:20%">
|
||||
@ -186,7 +186,7 @@
|
||||
</div>
|
||||
<div class="my-divider-item"></div>
|
||||
<div>
|
||||
<button onclick="info(this)" style="font-size: 8rem">info</button>
|
||||
<button onclick="info(this)" style="font-size: 16px">info</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -205,8 +205,8 @@
|
||||
<footer>
|
||||
|
||||
</footer>
|
||||
<div id="testDiv" style="font-size: 16rem; width: 300px;margin-left: 10%; display: block"></div>
|
||||
<div id="testDevice" style="font-size: 16rem; width: 300px;margin-left: 10%; display: block"></div>
|
||||
<div id="testDiv" style="font-size: 14px; width: 300px;margin-left: 10%; display: block"></div>
|
||||
<div id="testDevice" style="font-size: 14px; width: 300px;margin-left: 10%; display: block"></div>
|
||||
|
||||
</body>
|
||||
<script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user