Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yeah, you can't constrain the iframe itself with height and width. You should put a div around it. If you control the content in the iframe, you can put some JS within the iframe content that will tell the parent to scroll the div when the touch event is received. </p> <p>like this:</p> <p>The JS:</p> <pre><code>setTimeout(function () { var startY = 0; var startX = 0; var b = document.body; b.addEventListener('touchstart', function (event) { parent.window.scrollTo(0, 1); startY = event.targetTouches[0].pageY; startX = event.targetTouches[0].pageX; }); b.addEventListener('touchmove', function (event) { event.preventDefault(); var posy = event.targetTouches[0].pageY; var h = parent.document.getElementById("scroller"); var sty = h.scrollTop; var posx = event.targetTouches[0].pageX; var stx = h.scrollLeft; h.scrollTop = sty - (posy - startY); h.scrollLeft = stx - (posx - startX); startY = posy; startX = posx; }); }, 1000); </code></pre> <p>The HTML:</p> <pre><code>&lt;div id="scroller" style="height: 400px; width: 100%; overflow: auto;"&gt; &lt;iframe height="100%" id="iframe" scrolling="no" width="100%" id="iframe" src="url" /&gt; &lt;/div&gt; </code></pre> <p>If you don't control the iframe content, you can use an overlay over the iframe in a similar manner, but then you can't interact with the iframe contents other than to scroll it - so you can't, for example, click links in the iframe.</p> <p>It used to be that you could use two fingers to scroll within an iframe, but that doesn't work anymore.</p> <p><em><strong>Update: iOS 6 broke this solution for us.</em></strong> I've been attempting to get a new fix for it, but nothing has worked yet. In addition, it is no longer possible to debug javascript on the device since they introduced Remote Web Inspector, which requires a Mac to use.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload