From b42fae96e5836abd1207b6fc8d55b5a6127892bc Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 28 Apr 2014 09:13:57 +0200 Subject: [PATCH] load all images directly when in 'no-transform'-mode --- js/reveal.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/reveal.js b/js/reveal.js index 01472a6..4b84019 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -208,6 +208,17 @@ if( !features.transforms2d && !features.transforms3d ) { document.body.setAttribute( 'class', 'no-transforms' ); + // Since JS won't be running any further, we need to load all + // images that were intended to lazy load now + var images = document.getElementsByTagName( 'img' ); + for( var i = 0, len = images.length; i < len; i++ ) { + var image = images[i]; + if( image.getAttribute( 'data-src' ) ) { + image.setAttribute( 'src', image.getAttribute( 'data-src' ) ); + image.removeAttribute( 'data-src' ); + } + } + // If the browser doesn't support core features we won't be // using JavaScript to control the presentation return;