我有多个弹出我想显示到不同的标签与锚链接,我正在寻找一个解决方案来做到这一点。如何使用Bootstrap Tour弹出窗口浏览选项卡?
我已阅读issue #78,其中有人明显使用onShow
参数代替redirect
,但我没有用这些函数来舒服,我无法使其工作。
我正在做的是使用onNext()
和onPrev()
函数在显示下一个(或前一个)弹出窗口之前使用JQuery打开选项卡。
我的问题是,例如,在弹出元素“tour2”显示后(通过单击下一步),选项卡#tab3被正确显示,但不幸的是没有弹出元素“tour3”。
我注意到,如果我加载之前的选项卡,然后再次加载选项卡#tab3,突然出现popover元素“tour3”。
任何想法这可能是错误的?
这是我使用的代码:
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();
谢谢