Skip to content
Snippets Groups Projects
Commit 2c78eea0 authored by Andy Matthews's avatar Andy Matthews
Browse files

Firing custom event based on data-state name. This allows developers to...

Firing custom event based on data-state name. This allows developers to trigger custom javascript code on a per slide basis.
parent 83123689
No related branches found
No related tags found
No related merge requests found
......@@ -501,6 +501,10 @@ var Reveal = (function(){
// Apply the new state
for( var i = 0, len = state.length; i < len; i++ ) {
document.documentElement.classList.add( state[i] );
// dispatch custom event
var event = document.createEvent("HTMLEvents");
event.initEvent(state[i], true, true);
document.dispatchEvent(event);
}
// Update progress if enabled
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment