In the outer layer of the IFRAME, the contents are added to the container through AppendChild (), the complete code is as follows:
1 @section Css2 {3<link href= "@ViewHelper. Content ("/content/css/mobiscroll.css ")" rel= "stylesheet" type= "Text/css"/>4<link href= "@ViewHelper. Content ("/content/css/common.css ")" Rel= "stylesheet"/>5 }6 <style>7 . Frame {8 margin-top:55px;9 padding:10px;Ten HEIGHT:90VH; One WIDTH:100VW; A Border:none; - } - </style> the<div id= "Iframe-box"> -<iframe id= "Ifram" class= "frame" width= "420" height= "src=" @ViewBag. Pathurl.replace ("http://", "https://") "></iframe> - </div> - @section js{ + <script> - var ifram = document.getElementById (' Ifram '); + if (Navigator.userAgent.match (/ipad|iphone/i)) { A var iframe_box = document.getElementById (' Iframe-box '); at iframe_box.style.width = + '% '; - Iframe_box.style.overflowX = ' hidden '; - Iframe_box.style.overflowY = ' scroll '; - iframe_box.style.webkitOverflowScrolling = ' touch '; - ifram.setattribute (' scrolling ', ' no '); - Iframe_box.appendchild (ifram); in } - </script> to}
iOS does not support IFRAME solutions