Mathemats
Mathemats

Reputation: 1185

Exit bootstrap tour on modal close

I'm using Bootstrap Tour to display help steps on a modal. My problem is that when the modal is closed or dismissed (by clicking outside the modal) the tour popup lingers and none of the buttons work (end tour, prev, next).

How can I exit the tour when the modal is closed?

Upvotes: 2

Views: 574

Answers (1)

swellerd
swellerd

Reputation: 26

When using Bootstrap 3 modals you can bind js to the cancel/exit event like this:

$('#modal').on('hidden.bs.modal', function () {
    tour.exit();
});

You could also jump to a previous tour step, if there are any before the modal.

Upvotes: 1

Related Questions