How can I scroll an iframe in iOS 4 with 2 fingers?

后端 未结 1 1639
傲寒
傲寒 2021-01-14 13:42

I\'ve found many related questions but none with an answer that explains how to scroll an iframe using the 2 finger method in iOS 4.

I am able to scroll

相关标签:
1条回答
  • 2021-01-14 14:21

    A simple idea posted by rossb @ github.com/fancyapps worked beautifully for both scrolling in iOS 4 (2 fingers) and iOS 5 (1 finger) and solves the "blank content on scroll" issues that iOS 5's iframes seem to be plagued with. Basically, you don't want the iframe to handle any scrolling. Give it a fixed width/height and wrap the scrollable content in your included file in a div that can be scrolled.

    Here's an example:

    <iframe id="stupid-iframe" width="600" height="200" src="a-file.html"></iframe>
    

    a-file.html:

    <html>
    <body>
    <div id="wrapper" style="width: 100%; height: 100%; overflow: auto; -webkit-overflow-scrolling: touch;">
    ...all my normal content...
    </div>
    </body>
    </html>
    
    0 讨论(0)
提交回复
热议问题