diff options
author | Hakim El Hattab | 2016-04-28 11:16:36 +0200 |
---|---|---|
committer | Hakim El Hattab | 2016-04-28 11:16:36 +0200 |
commit | fcb6ea8385487194f257b9d556f9c98d0ec73301 (patch) | |
tree | e07111723071b18670328f88efc33ea8abe85988 /js | |
parent | 66c4e6a77fed49cf970ac306b50320f409abbc6b (diff) |
prevent pages from overflowing when printing to pdf
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/js/reveal.js b/js/reveal.js index 8975504..bbe2ca4 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -597,6 +597,15 @@ top = Math.max( ( pageHeight - contentHeight ) / 2, 0 ); } + // Wrap the slide in a page element and hide its overflow + // so that no page ever flows onto another + var page = document.createElement( 'div' ); + page.className = 'page'; + page.style.overflow = 'hidden'; + page.style.height = ( pageHeight * numberOfPages ) + 'px'; + slide.parentNode.insertBefore( page, slide ); + page.appendChild( slide ); + // Position the slide inside of the page slide.style.left = left + 'px'; slide.style.top = top + 'px'; |