Skip to content

Instantly share code, notes, and snippets.

@JulioTalavera
Forked from mrsweaters/pause_and_resume.md
Created March 21, 2013 11:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save JulioTalavera/5212444 to your computer and use it in GitHub Desktop.

The below configuration will pause the tour after tooltip 2 has appeared (index of 1). In the postStepCallback we check to see if the tour has been paused and fire some code.

<script>
  $(window).load(function() {
    $('#joyRideTipContent').joyride({
      pauseAfter : [1],
      postStepCallback : function (index, tip) {
        if ($(this).joyride('paused')) {
          console.log('Hey there, you\'ve paused the tour.');
          // fire your code here
        }
      }
    });
  });
</script>

When our code has finished executing we can fire $(window).joyride('resume'); and the tour will continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment