Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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