'slidechanged' event, added Reveal.addEventListener/Reveal.removeEventListener api methods
This commit is contained in:
10
index.html
10
index.html
@ -148,7 +148,7 @@
|
||||
<p>
|
||||
Additionally custom events can be triggered on a per slide basis by binding to the <code>data-state</code> name.
|
||||
</p>
|
||||
<pre><code contenteditable style="font-size: 18px; margin-top: 20px;">document.addEventListener( 'customevent', function() {
|
||||
<pre><code contenteditable style="font-size: 18px; margin-top: 20px;">Reveal.addEventListener( 'customevent', function() {
|
||||
alert( '"customevent" has fired' );
|
||||
} );
|
||||
</code></pre>
|
||||
@ -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,
|
||||
|
Reference in New Issue
Block a user