raise slide visiblility events
diff --git a/inst/rmarkdown/templates/revealjs_presentation/default.html b/inst/rmarkdown/templates/revealjs_presentation/default.html
index 46d21c0..754204f 100644
--- a/inst/rmarkdown/templates/revealjs_presentation/default.html
+++ b/inst/rmarkdown/templates/revealjs_presentation/default.html
@@ -175,5 +175,16 @@
</script>
$endif$
+<script>
+ (function() {
+ if (window.jQuery) {
+ Reveal.addEventListener( 'slidechanged', function(event) {
+ window.jQuery(event.previousSlide).trigger('hidden');
+ window.jQuery(event.currentSlide).trigger('shown');
+ });
+ }
+ })();
+</script>
+
</body>
</html>