Adding example for custom event binding.
authorandy matthews <andy@commadelimited.com>
Mon, 30 Apr 2012 14:07:23 +0000 (09:07 -0500)
committerandy matthews <andy@commadelimited.com>
Mon, 30 Apr 2012 14:07:23 +0000 (09:07 -0500)
index.html

index 5346e34915f825c69a1d8486790bb839f653f570..0e30911aa42d2782a63fae5c409a641e714bdada 100644 (file)
                                        </section>
                                </section>
 
+                               <section data-state="customevent">
+                                       <h2>Custom Events</h2>
+                                       <p>
+                                               Additionally custom events can be triggered on a per slide basis by binding to the <code>data-state</code> name.
+                                       </p>
+                                       <p><code style="font-size: 27px;">
+                                               document.addEventListener('customevent', function(){<br />
+                                                       alert('event has fired');<br />
+                                               });
+                                       </code></p>
+                               </section>
+
                                <section>
                                        <h2>Clever Quotes</h2>
                                        <p>
                                query[ a.split( '=' ).shift() ] = a.split( '=' ).pop();
                        } );
 
+                       document.addEventListener('customevent', function(){
+                               alert('event has fired');
+                       });
+
                        Reveal.initialize({
                                // Display controls in the bottom right corner
                                controls: true,