aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorHakim El Hattab <hakim.elhattab@gmail.com>2012-05-04 00:01:20 -0400
committerHakim El Hattab <hakim.elhattab@gmail.com>2012-05-04 00:01:20 -0400
commit19b67aab1314818b71ea39323c74308c6073f52d (patch)
tree9f9df74ccf375cae78278d9b3b54f6fac8487f50 /README.md
parentebb834f4b0b42363e3a59836fc1f2aa15a691c77 (diff)
downloadfreenode-live-2017-presentation-19b67aab1314818b71ea39323c74308c6073f52d.tar
freenode-live-2017-presentation-19b67aab1314818b71ea39323c74308c6073f52d.tar.gz
'slidechanged' event, added Reveal.addEventListener/Reveal.removeEventListener api methods
Diffstat (limited to 'README.md')
-rw-r--r--README.md18
1 files changed, 16 insertions, 2 deletions
diff --git a/README.md b/README.md
index 20965a9..12ca7e4 100644
--- a/README.md
+++ b/README.md
@@ -68,16 +68,27 @@ The Reveal class provides a minimal JavaScript API for controlling its navigatio
### States
-If you set ``data-state="someState"`` on a slide ``<section>``, "someState" will be applied as a class on the document element when that slide is opened. This allows you to apply broad style changes to the page based on the active slide.
+If you set ``data-state="somestate"`` on a slide ``<section>``, "somestate" will be applied as a class on the document element when that slide is opened. This allows you to apply broad style changes to the page based on the active slide.
Furthermore you can also listen to these changes in state via JavaScript:
```
-document.addEventListener( 'someState', function() {
+Reveal.addEventListener( 'somestate', function() {
// TODO: Sprinkle magic
}, false );
```
+### Slide change event
+
+An 'slidechanged' event is fired each time the slide is changed (regardless of state). The event object holds the index of the current slide.
+
+```
+Reveal.addEventListener( 'slidechanged', function( event ) {
+ // event.indexh & event.indexv
+} );
+```
+
+
## Examples
* http://lab.hakim.se/reveal-js/ (original)
@@ -104,6 +115,9 @@ document.addEventListener( 'someState', function() {
#### 1.3 (master)
- Revised keyboard shortcuts, including ESC for overview, N for next, P for previous. Thanks [mahemoff](https://github.com/mahemoff)
- Added support for looped presentations via config
+- Fixed IE9 fallback
+- Added event binding methods (Reveal.addEventListener, Reveal.removeEventListener)
+- Added 'slidechanged' event
#### 1.2