Bootstrap Tour如何只在一个页面上显示

时间:2018-01-14 18:07:20

标签: javascript jquery twitter-bootstrap bootstrap-tour

我正在尝试使用Bootstrap Tour设置我的应用程序的导览,但我遇到了一些问题。主要是我使用node.js和模板构建我的应用程序。我需要在单个页面上显示其中一个popovers只显示/dashboard而不是其他所有内容。现在,对于模板来说,这将是很好的execpt意味着我想要它的div在sidebar.html模板中。这是我的代码:

(function(){

var tour = new Tour({
    storage : false,
     steps: [
    {
      element: ".tour-step.tour-step-one",
      placement: "top",
      title: "Welcome to Phantom AM!",
      content: "This tour will guide you through some of the features we'd like to point out.",
    },
    {
      element: ".tour-step.tour-step-two",
      placement: "bottom",
      title: "Quick Tracker",
      content: "These four boxes show a quick look at what you have tracked so far.",
    },
    {
      element: ".tour-step.tour-step-three",
      placement: "bottom",
      title: "Add a manufacturer",
      content: "Start by adding a manufacturer.",
    },
    {
        element: ".tour-step.tour-step-four",
        title: "Title of my step",
        content: "Content of my step",
        path: "/dashboard/it/manufacturer/new"
    },

]
});

// Initialize the tour
tour.init();

// Start the tour
tour.start();

}());

设置三是给我带来问题的那个。我试过host,但也许我错了。

1 个答案:

答案 0 :(得分:-1)

我可能会创建这样的东西:

$('.btn').popover();

$('.btn').on('click', function (e) {
    $('.btn').not(this).popover('hide');
});

然后专门隐藏/显示在仪表板页面上。