From 19b67aab1314818b71ea39323c74308c6073f52d Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Fri, 4 May 2012 00:01:20 -0400 Subject: 'slidechanged' event, added Reveal.addEventListener/Reveal.removeEventListener api methods --- index.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 7f291cf..f314cdb 100644 --- a/index.html +++ b/index.html @@ -148,7 +148,7 @@
Additionally custom events can be triggered on a per slide basis by binding to the data-state
name.
document.addEventListener( 'customevent', function() {
+ Reveal.addEventListener( 'customevent', function() {
alert( '"customevent" has fired' );
} );
@@ -261,10 +261,16 @@ linkify( 'a' );
query[ a.split( '=' ).shift() ] = a.split( '=' ).pop();
} );
- document.addEventListener( 'customevent', function() {
+ // Fires when a slide with data-state=customevent is activated
+ Reveal.addEventListener( 'customevent', function() {
alert( '"customevent" has fired' );
} );
+ // Fires each time a new slide is activated
+ Reveal.addEventListener( 'slidechanged', function( event ) {
+ // event.indexh & event.indexv
+ } );
+
Reveal.initialize({
// Display controls in the bottom right corner
controls: true,
--
cgit v1.2.3