zurb / joyride

jQuery feature tour plugin.
http://www.zurb.com/playground/jquery-joyride-feature-tour-plugin
1.42k stars 238 forks source link

Joyride callbacks fire on plugin load no matter what #192

Closed JohnnyKB closed 9 years ago

JohnnyKB commented 9 years ago

I execute Joyride when a condition is met, and after going nuts as to why the postRideCallback was firing when I executed Joyride, I test this out for debugging purposes:

$('#joyRideTipContent').joyride({
                autoStart : true,
                modal: true,
                expose: true,
                tipLocation: 'top',
                'postExposeCallback': console.log('postExposeCallback'),
                'preRideCallback': console.log('preRideCallback'),
                'postRideCallback': console.log('postRideCallback'),
                'preStepCallback': console.log('preStepCallback'),
                'postStepCallback': console.log('postStepCallback')
            });

The console shows this, which appears all at once:

screen shot 2014-12-04 at 19 36 54

For some reason, all the callbacks are fired as soon as the plugin kicks in.

JohnnyKB commented 9 years ago

Well, nevermind. Javascript 101: if I add a function or a console log in the callback definitions, it will be executed on plugin load. Once I overcame that stupid mistake on my behalf, everything was working as expected.

Thank you for your great work, and replying on Twitter! Johnny.