Search code examples
javascriptjqueryzurb-joyride

Zurb Joyride: start at index #, not working


I have a working joyride, that will move through all of the steps, however I am in the process of adding a steps counter/navigation to it that will allow the user to (like a jquery gallery slider) move between tips on click of a li. My problem is that in my attempt to use the startOffset: #, I am unable to get the desired result.

function move_to_walkthrough(step_number){

  $("#joyRideTipContent").joyride({
    startOffset:4, (this will be step_number)
    autoStart:true,
  });

}

My original thought was to restart the joyride on each click of the tips navigation (a simple ul li list with each li having a # associated to it to indicate which tip(s) are showing (as tip numbers vary depending on what's been presented to the user). Can any one tell me what I'm doing wrong.


Solution

  • I figured out the problem, only to have another pop up. The short answer is, you need to call

                .joyride('destroy');
    

    On the the existing instance of joyride, in-order for it to restart. However the new problem is that after navigating to a new index, it ceases to work for others.