I have an iframe and i need it to have a scrolling overflow. it seems work out in desktop, i used a work around to make it work in iOS. it works on android and iOS now. however, iOS8 it fails.
<html>
<body>
<style type="text/css">
.scroll-container {
overflow: scroll;
-webkit-overflow-scrolling: touch;
}
#iframe_survey {
height: 100%;
}
.scroll-container {
height: 100%;
width: 100%;
overflow: scroll;
}
</style>
<div class="scroll-container scroll-ios">
<iframe id="iframe_survey" src="www.iframe.com" style="border:0px #FFFFFF none;" name="myiFrame" frameborder="0" marginheight="0px" marginwidth="0px" width="100%"></iframe>
</div>
</body>
The must is define your
scroll-container
tofixed
for the div is a fullscreen size. Then inside the iframe create a main content who have a properties scrolling.Inside you iframe, in the
mainContainer-scroll
, you can add:-webkit-overflow-scrolling: touch
//For active smooth scroll-webkit-transform: translate3d(0, 0, 0)
//For material accelerationoverflow-y:scroll;
//For add scrolling in y axisposition:absolute;height:100%;width:100%;top:0;left:0;
//For fix the containerMain page
Inside Iframe
Not knowing what is on the other end of "www.iframe.com"...but for me, in that file's css I added:
That fixed it.
Use the code in this way
it did not work for me! but I could figure out a little trick after reading this post: https://css-tricks.com/forums/topic/scrolling-iframe-on-ipad/
Just put an !important after that and works just fine!
I was able to make an iframe scroll in iOS by placing an
iframe
inside adiv
(which acts as container) and apply the styles as follows and this works perfectly.As i am working in GWT, for GWT people here is the suggestion. In case of GWT just place an iframe in ScrollPanel (div) and apply the styles as above.
In order to make an iframe scrollable on iOS, you have to add the CSS3 property
-webkit-overflow-scrolling: touch
to the parent container: