Pārlūkot izejas kodu

Examples: Nicer workaround for iOS iframe issue.

Mr.doob 9 gadi atpakaļ
vecāks
revīzija
c0537d2fba
1 mainītis faili ar 4 papildinājumiem un 7 dzēšanām
  1. 4 7
      examples/index.html

+ 4 - 7
examples/index.html

@@ -264,16 +264,13 @@
 			event.preventDefault();
 		} );
 
-		// iOS8 workaround
+		// iOS iframe auto-resize workaround
 
 		if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
 
-			viewer.addEventListener( 'load', function ( event ) {
-
-				viewer.contentWindow.innerWidth -= 10;
-				viewer.contentWindow.innerHeight -= 2;
-
-			} );
+			viewer.style.width = window.innerWidth - 310 + 'px';
+			viewer.style.height = window.innerHeight + 'px';
+			viewer.setAttribute( 'scrolling', 'no' );
 
 		}