Răsfoiți Sursa

fix iframe unload in firefox

Hakim El Hattab 10 ani în urmă
părinte
comite
e16a220a62
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      js/reveal.js

+ 3 - 0
js/reveal.js

@@ -2986,6 +2986,9 @@
 
 			// Lazy loading iframes
 			toArray( slide.querySelectorAll( 'iframe[data-src]' ) ).forEach( function( el ) {
+				// Only removing the src doesn't actually unload the frame
+				// in all browsers (Firefox) so we set it to blank first
+				el.setAttribute( 'src', 'about:blank' );
 				el.removeAttribute( 'src' );
 			} );
 		}