I have multiple popovers I would like to display into different tabs with anchor links and I'm looking for a solution to do that.
I have read the issue #78 in which somebody apparently made it to work using the onShow
parameter instead of the redirect
but I'm not confortable with these function and I'm unable to make it works.
What I'm doing is using the onNext()
and onPrev()
function to open the tab with JQuery right before the next (or the previous) popover is displayed.
My problem is that, for example, after the popover element "tour2" is displayed (by clicking Next) the tab #tab3 is correctly displayed but unfortunnatly there is no popover element "tour3".
I noticed that if I load the previous tab and then load the tab #tab3 again the popover element "tour3" suddenly appears.
Any idea what could be wrong with this ?
This is the code I use :
var tour = new Tour({
name: "tour",
container: "body",
smartPlacement: true,
keyboard: true,
storage: false,
steps: [
{
element: "#tour1", // this popover is on tab2
title: "Title here",
content: "some content here"
},
{
element: "#tour2", // this popover is on tab2
title: "Title here",
content: "some content here",
onNext:function(tour){
jQuery('.nav a[href="#tab3"]').tab('show');
}
},
{
element: "#tour3", // this popover is on tab3
title: "Title here",
content: "some content here",
onPrev:function(tour){
jQuery('.nav a[href="#tab2"]').tab('show');
}
}
]
});
// Initialize the tour
tour.init();
// Start the tour
tour.start();
Thank you,