// Example of binding an event to a state. This listener will trigger
// when the slide with 'data-state="blurred"' is opened.
- document.querySelector( '#reveal' ).addEventListener( 'blurred', function() {
+ document.addEventListener( 'blurred', function() {
}, false );
// Dispatch custom event
var event = document.createEvent( "HTMLEvents" );
- event.initEvent( state[i], false, true );
- dom.wrapper.dispatchEvent( event );
+ event.initEvent( state[i], true, true );
+ document.dispatchEvent( event );
}
// Clean up the remaints of the previous state