The H5 page I made is compatible with the mobile side. The mobile page can be displayed normally on the Android, but the pc page is still displayed on the ios.

the style displayed on the ios shows the result of the style on the PC side. I use
var nWidth = window.innerWidth in the js file | | document.documentElement.clientWidth;

if(nWidth > 500){
    alert("pc")
}else{
    alert("miblie")
}
 "pc" 
Mar.22,2021

js to determine whether the mobile end or the pc side knows. Judging by the size of the equipment, it must not be an exact match.
clipboard.png


window.innerWidth the width of the document display area of the returned window
, that is to say, for example, there is only one div > width 1000px on your page, then what you get at the bottom of the page window.innerWidth is 10008 , 1000+body.margin


. User-scalable=no "> code >


Thank you for the boss. The problem is solved, or there is a problem with their own page layout. I feel that the requirement of ios on H5 is higher than Android


how to solve it? ask the boss for advice. I also encountered this problem, which is very uncomfortable.


I would like to ask you how to deal with the abnormal display of your h5 page in ios. My pc page has shrunk on ios, and he enlarged it by adding meta.

Menu