aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/reveal.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/js/reveal.js b/js/reveal.js
index 5805ee9..9634c6b 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -1446,6 +1446,7 @@
var size = getComputedSlideSize();
var slidePadding = 20; // TODO Dig this out of DOM
+ var zTransform = z !== 0 ? 'translateZ(-'+ z +'px)' : '';
// Layout the contents of the slides
layoutSlideContents( config.width, config.height, slidePadding );
@@ -1467,13 +1468,13 @@
dom.slides.style.top = '';
dom.slides.style.bottom = '';
dom.slides.style.right = '';
- transformElement( dom.slides, '' );
+ transformElement( dom.slides, zTransform );
}
else {
// Prefer zooming in desktop Chrome so that content remains crisp
if( !isMobileDevice && /chrome/i.test( navigator.userAgent ) && typeof dom.slides.style.zoom !== 'undefined' ) {
dom.slides.style.zoom = scale;
- transformElement( dom.slides, 'translateZ(-'+ z +'px)' );
+ transformElement( dom.slides, zTransform );
}
// Apply scale transform as a fallback
else {
@@ -1481,7 +1482,7 @@
dom.slides.style.top = '50%';
dom.slides.style.bottom = 'auto';
dom.slides.style.right = 'auto';
- transformElement( dom.slides, 'translate(-50%, -50%) scale('+ scale +')' + ' translateZ(-'+ z +'px)' );
+ transformElement( dom.slides, 'translate(-50%, -50%) scale('+ scale +') ' + zTransform );
}
}