mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-09-03 19:52:37 +02:00
lazy-load iframes only for current slide, unload when hidden
This commit is contained in:
@@ -495,6 +495,15 @@ Reveal.addEventListener( 'ready', function() {
|
||||
strictEqual( document.querySelectorAll( '.reveal section img[src]' ).length, 1, 'Image source has been set' );
|
||||
});
|
||||
|
||||
test( 'iframe with data-src', function() {
|
||||
Reveal.slide( 0, 0 );
|
||||
strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 0, 'Iframe source is not set' );
|
||||
Reveal.slide( 2, 0 );
|
||||
strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 1, 'Iframe source is set' );
|
||||
Reveal.slide( 2, 1 );
|
||||
strictEqual( document.querySelectorAll( '.reveal section iframe[src]' ).length, 0, 'Iframe source is not set' );
|
||||
});
|
||||
|
||||
test( 'background images', function() {
|
||||
var imageSource1 = Reveal.getSlide( 0 ).getAttribute( 'data-background-image' );
|
||||
var imageSource2 = Reveal.getSlide( 1, 0 ).getAttribute( 'data-background' );
|
||||
|
Reference in New Issue
Block a user