hakimel/reveal.js — pull request #37 by functino (2012-05-02 16:48:36+00:00)
Title: Add the possibility to register a callback for slide changes

Add the possibility to register a callback with Reveal.onSlideChange = funnction(indexh, indexv){} which get's called on each slideChange.

This would - for example - make it possible to synchronize/share the presentation between multiple browser instances.
An example with faye/websockets:
On the "master"-presentation of the speaker:
Reveal.onSlideChange = function(indexh, indexv) {
faye.publish("/reveal/navigateTo", {indexh: indexh, indexv: indexv});
}

On the "slave"-presentations of the attendees:
faye.subscribe("/reveal/navigateTo", function(slide){
Reveal.navigateTo(slide.indexh, slide.indexv);
});

Another approach to enable something like this could be to expose a function like Reveal.addEventListener("slideChange", function(...){});