zurb / joyride

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

How do you set settings while joyride is running? #162

Open carbontwelve opened 10 years ago

carbontwelve commented 10 years ago

Is there an easy way of setting a configuration value while the joyride is running? I wish to switch the scrolling functionality off during certain steps and back on for others.

I couldn't find a way to do this inherent within joyride so I wrote the below "method" into the js at line 394:

    set_scroll : function(opts){
          if (opts == true){
              settings.scroll = true;
          }else{
              settings.scroll = false;
          }
      },

With usage inside my html via

    $('#chooseID').joyride({
            autoStart : true,
                postStepCallback : function (index, tip) {
                    switch( index )
                    {
                        case 6:
                            $(this).joyride('set_scroll', false);
                        break;
                        case 8:
                            $(this).joyride('set_scroll', true);
                        break;

                    }
                }
            },
            modal: true,
            expose: true
    });

Is there a way of doing this already baked in? I couldn't find one as my js skills are quite basic.

Thanks.