Skip to content

Instantly share code, notes, and snippets.

@perliedman
Created April 4, 2016 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perliedman/544f479eca31378fa538923413e42b7c to your computer and use it in GitHub Desktop.
Save perliedman/544f479eca31378fa538923413e42b7c to your computer and use it in GitHub Desktop.
L.Map.addInitHook(function() {
var slides = document.querySelector('.slides'),
zoom = Number(slides.style.zoom);
// Reveal.js sometimes use the zoom CSS property, but sometimes a scale
// transform instead. We handle both.
if (zoom) {
this._container.style.zoom = 1/zoom;
} else {
zoom = Number(slides.style.transform.replace(/.*scale\(([0-9\.]+)\).*/, '$1'));
this._container.style.transform = 'scale(' + (1 / zoom) + ')';
}
this.invalidateSize();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment