The perfect solution for iOS that does not support IFrame recently made the public page, because the entry is different, you need to extract the public page, and then according to different values, pass to the background of different portals. Initially nested with the IFRAME page (first attempt), but found that the iOS system on the IFRAME nested page height and positioning control is not in place, when the height of the nested sub-page is greater than the height of the parent page, and the child page has a trigger box event, at this time, if the child page height is far greater than the parent page height, will appear in the box can not find the situation, in fact, may be in the viewport below, the location of the box is only relative to the sub-page to locate, and there is no relative to the viewport positioning.
Try a good variety of methods, are not ideal, and the Android system is performing well, then think that the iOS system can directly do page jumps, and Android system is normal use of IFRAME (if the Android system directly to do page jump, there will be problems, so use IFRAME),
Look directly at the code:
<! DOCTYPE html>
<meta charset= "UTF-8" >
<meta name= "viewport" content= "width=device-width,initial-scale=1,user-scalable=0" >
<body>
<script src= "Js/zepto.min.js" ></script>
<script>
$ (function () {
var originid = Sessionstorage.setitem (' originid ', ' 3 '); Originid for background needs to determine which entry is the value
var u = navigator.useragent;
var isandroid = u.indexof (' Android ') >-1 | | U.indexof (' Adr ') >-1; Android Terminal
var Isios =!! U.match (/\ (i[^;] +;( U;)? Cpu.+mac OS x/); iOS terminal
if (isandroid) {
Use IFRAME on Android terminal
var Winh = $ (window). Height ();
var iframe = document.createelement (' iframe ');
IFRAME.SRC = "index_common.html";
Iframe.style.width = ' 100% ';
Iframe.style.height = Winh + ' px ';
Iframe.style.border = ' 0 none ';
Iframe.setattribute (' scrolling ', ' auto ');
Document.body.appendChild (IFRAME);
} else if (Isios) {
iOS Terminal direct page jump
Location.href = ' index_common.html ';
} else {
Location.href = ' index_common.html ';
}
})
</script>
</body>
Workarounds for iOS that do not support IFRAME