Skip to content

Commit c0537d2

Browse files
committed
Examples: Nicer workaround for iOS iframe issue.
1 parent 8bf4a9e commit c0537d2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

examples/index.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,16 +264,13 @@ <h1><a href="http://threejs.org">three.js</a> / examples</h1>
264264
event.preventDefault();
265265
} );
266266

267-
// iOS8 workaround
267+
// iOS iframe auto-resize workaround
268268

269269
if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
270270

271-
viewer.addEventListener( 'load', function ( event ) {
272-
273-
viewer.contentWindow.innerWidth -= 10;
274-
viewer.contentWindow.innerHeight -= 2;
275-
276-
} );
271+
viewer.style.width = window.innerWidth - 310 + 'px';
272+
viewer.style.height = window.innerHeight + 'px';
273+
viewer.setAttribute( 'scrolling', 'no' );
277274

278275
}
279276

0 commit comments

Comments
 (0)