updated wrong variable names in the demo
Trigger an event when the slide changes
normalize some syntax