javascript - Bootstrap Tour如何只显示在一页上

标签 javascript jquery twitter-bootstrap bootstrap-tour

我正在尝试使用 Bootstrap Tour 设置我的应用程序的 Bootstrap 式浏览,但遇到了一些问题。主要的一件事是我使用 node.js 和模板构建了我的应用程序。我需要让其中一个弹出窗口仅显示在单个页面上 /dashboard 而不是其他所有内容。现在,对于模板来说就很好了,这意味着我希望它位于的 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 但也许我用错了。

最佳答案

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

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

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

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

关于javascript - Bootstrap Tour如何只显示在一页上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48252586/

相关文章:

javascript - ExternalInterface addCallback 多次失败

css - 如何在给定高度将 bootstrap 4 中的容器居中?

php - 在 CSS 中使用数据图标

javascript - 在下拉菜单中选择选项后 append 新的输入字段

javascript - 选择页面上的 2 个按钮

javascript - jQuery 获取 div 的内容并使其成为其父元素的类

css - LESS CSS 中的 `&::` 语法是什么?

javascript - 有没有一种在 JQuery 中切换选项卡的方法?

javascript - 如何阻止ajax重复之前的请求?

javascript - JavaScript 解释中的原型(prototype)可重用性