This commit is contained in:
shaoyongjun 2024-10-31 21:12:13 +08:00
parent 41a1a867fc
commit cd10df9ad9
2 changed files with 12 additions and 2 deletions

View File

@ -339,6 +339,13 @@ export class MyUtils {
}
console.log("body-frontSize: ", myEditFrontSize.style.fontSize);
setTimeout(() => {
this.keyBoardHeight = window.innerHeight - window.visualViewport.height;
// console.log("mobile: ", this.keyBoardHeight);
let testDiv = document.getElementById("testDevice");
testDiv.innerText = "\nmobile: " + this.keyBoardHeight
}, 800);
}
/**

View File

@ -26,7 +26,8 @@ import {MyEventListener} from "./event/MyEventListener.js";
isMobile: /mobi|android|iphone|ipad|ipod/i.test(navigator.userAgent.toLocaleLowerCase()),
isIOS: /iphone|ipad|ipod/.test(window.navigator.userAgent.toLocaleLowerCase()),
isAndroid: /android/.test(window.navigator.userAgent.toLocaleLowerCase()),
//高度 for android
originHeight: document.documentElement.clientHeight || document.body.clientHeight,
/**
* 默认body front-size 单位px
*/
@ -183,7 +184,9 @@ window.onload = function () {
setTimeout(() => {
this.keyBoardHeight = window.innerHeight - window.visualViewport.height;
console.log("mobile: ", this.keyBoardHeight)
// console.log("mobile: ", this.keyBoardHeight);
let testDiv = document.getElementById("testDevice");
testDiv.innerText = "\nmobile: " + this.keyBoardHeight
}, 800);
}
}