EragonJ / Trip.js

🚀 Trip.js is a plugin that can help you customize a tutorial trip easily with more flexibilities.
https://eragonj.github.io/Trip.js/
MIT License
793 stars 111 forks source link

Restart the entire trip #67

Closed Fire-Brand closed 10 years ago

Fire-Brand commented 10 years ago

I have a button that has a click event that runs trip.start() but the thing is, if a user closes with the trip-close 'x' before reaching the dismiss label, the button I use will start the trip from that same block and won't restart the entire trip.

i tried adding a function to the click event like this:

  $('.myClass').on("click", function() {
        trip.settings.tripIndex = 0;
        trip.start();
  });

but no luck, I actually viewed 'trip.settings.tripIndex' in the console right before I set it to 0 and saw it was already 0…

I thought about may be trying to do that with onTripClose, but not sure how to pass it in, as it only take : tripIndex and tripObject.

and ideas?

Fire-Brand commented 10 years ago

so, now with the fix how would i make sure that it would reset from a 'close' event?

EragonJ commented 10 years ago

@Fire-Brand just ... try xD

Fire-Brand commented 10 years ago

sweeeeeeeet! thanks