From aaf9da450f51ad3196681cd48e7921c73532ea4d Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 31 May 2012 21:31:28 -0400 Subject: dispatch events when visible fragment changes ('fragmentshown', 'fragmenthidden') closes #44 --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index ac57153..2c629b1 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,19 @@ Reveal.addEventListener( 'slidechanged', function( event ) { } ); ``` +### Fragment events + +When a slide fragment is either shown or hidden reveal.js will dispatch an event. + +``` +Reveal.addEventListener( 'fragmentshown', function( event ) { + // event.fragment = the fragment DOM element +} ); +Reveal.addEventListener( 'fragmenthidden', function( event ) { + // event.fragment = the fragment DOM element +} ); +``` + ## Examples @@ -126,6 +139,7 @@ Reveal.addEventListener( 'slidechanged', function( event ) { - Added print styles. Thanks [skypanther](https://github.com/skypanther) - The address bar now hides automatically on mobile browsers - Space and return keys can be used to exit the overview mode +- Events for fragment states ('fragmentshown'/'fragmenthidden') #### 1.2 -- cgit v1.2.3