HTML codeWhen using an IFRAME or other HTML element, you need to wrap them with an element such as a div:
<class= "Scroll-wrapper"> <src ="" ></ iframe > </ Div >
This div will be used as the underlying container to support internal scrolling.CSS CodeFor an IFRAME to support scrolling, you need a common CSS property and a CSS property that few people know about:
. scroll-wrapper { -webkit-overflow-scrolling:touch; OVERFLOW-Y: scroll; /* Tip: Please add the size (dimensions) or location (positioning) information you want to set here! */ } . scroll-wrapper iframe {/ * your own specified style */
-webkit-overflow-scrolling:touch; The property value is designed for elements that need to be scrolled when the browser overflows (overflow). If you do not specify this property, when you want to scroll the IFRAME, it will actually cause the outer page to scroll, through which you can control the IFRAME scrolling! In the original author's blog site, the following CSS was used:
. demo-iframe-holder { position:fixed; right:0; bottom:0; left:0; top:0; -webkit-overflow-scrolling:touch; OVERFLOW-Y: scroll; } . Demo-iframe-holder iframe { height:100%; width:100%; }
Transferred from: http://www.oicqzone.com/pc/2015040321369.html
"Go" lets the IFRAME support scrolling on the iOS device's mobile browser