Iframe Content Not Rendering Under Scroll In iOs5 iPad/iPhone

后端 未结 2 1596
遇见更好的自我
遇见更好的自我 2020-11-30 05:55

I\'m developing iPad html5 webpage that needs to display pages from other origins (different domains).

I\'m loading those pages into iframe, and scrolli

相关标签:
2条回答
  • 2020-11-30 06:40

    OK. found the solution. apparently, the problem appear when the main document height is shorter than the iframe that is scrolled. the parts of the iframe page, that exceed the document height, are not rendered.

    So, under my needs, I could solve the problem by adding such a js (with jquery) code:

    <script>
    $(function() {
         var iframe = $("#myIframe");    
         iframe.load(function() {
             $("body").height(iframe.height());
         });
     });
    </script>
    
    0 讨论(0)
  • 2020-11-30 06:51

    If you have an access to iFrame body, apply some transform3d to its content to enable GPU rendering.

    In my case adding -webkit-transform: translate3d(0, 0, 0); to main wrapping div did the job.

    0 讨论(0)
提交回复
热议问题