correct height of reveal.js on mobile devices, fixes vertical overflow

This commit is contained in:
Hakim El Hattab
2019-01-22 09:45:33 +01:00
parent c36caef5e7
commit 5002304fb1
3 changed files with 12 additions and 14 deletions

View File

@ -2065,6 +2065,16 @@
if( !config.disableLayout ) {
// On some mobile devices '100vh' is taller than the visible
// viewport which leads to part of the presentation being
// cut off. To work around this we define our own '--vh' custom
// property where 100x adds up to the correct height.
//
// https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
if( isMobileDevice ) {
document.documentElement.style.setProperty( '--vh', ( window.innerHeight * 0.01 ) + 'px' );
}
var size = getComputedSlideSize();
// Layout the contents of the slides