MUI packaged mobile version of the website is apk

Source: Internet
Author: User

Boss mentioned a function, is to make a good mobile phone site Http://xxx.com/m/home/index, think it should be quite simple, an HTML page in an IFRAME is good, and then the width and height are set to 100%, try the next, Width no problem , is the height of the words 100% is no use, tried in my MX2 mobile phone is 100% Open, tantalum is in the colleague's Huawei mobile phone can not open up, Internet search, you can use JS to get the height of the entire window, the following is the code, directly written in the new MUI The index.html page in the project.


<! DOCTYPE html>

<meta charset= "Utf-8" >
<meta name= "viewport" content= "initial-scale=1.0, maximum-scale=1.0, User-scalable=no"/>
<title></title>
<style>
* {
margin:0;
padding:0;
}
</style>
<script type= "Text/javascript" >
Document.addeventlistener (' Plusready ', function () {
Console.log ("All plus APIs should be called after this event occurs, otherwise the plus is undefined will appear.") "
var h = plus.webview.currentWebview (). Height; This is wrong, no value is taken
Console.log ("current page URL:" + Plus.webview.currentWebview (). GetURL () + ", Current window Height:" + h);

document.getElementById (' Frm1 '). Style.height = h + "px";
});

function Setiframeheight (IFRAME) {
if (IFRAME) {
var Iframewin = Iframe.contentwindow | | Iframe.contentDocument.parentWindow;
if (iframeWin.document.body) {
Iframe.height = IframeWin.document.documentElement.scrollHeight | | IframeWin.document.body.scrollHeight;
Console.log ("window height:" + iframe.height);
document.getElementById (' Frm1 '). Style.height = iframe.height + "px";
}
}
};

Window.onload = function () {
Setiframeheight (document.getElementById (' Frm1 '));
};
</script>

<body>
<iframe id= "Frm1" style= "border:none;width:100%;height:100%;" src= "http://baidu.com/" ></iframe>
</body>

MUI packaged mobile version of the website is apk

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.