diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2011-12-23 00:36:37 -0800 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2011-12-23 00:36:37 -0800 |
commit | adc9ad19cebd73b863558c80dd03c223b427c669 (patch) | |
tree | ac1f709342c05dbe24e4ca3472548c55e797d4e8 /js | |
parent | f6dc5312980150c68510a955e4ce8e5d2691b412 (diff) | |
download | perl-software-in-gnu-guix-adc9ad19cebd73b863558c80dd03c223b427c669.tar perl-software-in-gnu-guix-adc9ad19cebd73b863558c80dd03c223b427c669.tar.gz |
fallback on 2d transform transitions via feature detect
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/js/reveal.js b/js/reveal.js index 3dddf7d..01c7e8f 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -86,7 +86,13 @@ var Reveal = (function(){ config = {}, // Cached references to DOM elements - dom = {}; + dom = {}, + + // Detect support for CSS 3D transforms + supports3DTransforms = document.body.style['perspectiveProperty'] !== undefined || + document.body.style['WebkitPerspective'] !== undefined || + document.body.style['MozPerspective'] !== undefined || + document.body.style['msTransform'] !== undefined; /** * Starts up the slideshow by applying configuration @@ -117,6 +123,11 @@ var Reveal = (function(){ config.progress = options.progress === undefined ? false : options.progress; config.theme = options.theme === undefined ? 'default' : options.theme; + // Fall back on the 2D transform theme 'linear' + if( supports3DTransforms === false ) { + config.theme = 'linear'; + } + if( config.controls ) { dom.controls.style.display = 'block'; } @@ -240,9 +251,7 @@ var Reveal = (function(){ * Wrap all links in 3D goodness. */ function linkify() { - var supports3DTransforms = document.body.style['webkitPerspective'] !== undefined || - document.body.style['MozPerspective'] !== undefined || - document.body.style['perspective'] !== undefined; + if( supports3DTransforms ) { var nodes = document.querySelectorAll( 'section a:not(.image)' ); |