【问题标题】:Bootstrap tour not working in MVCBootstrap 导览在 MVC 中不起作用
【发布时间】:2014-04-18 18:43:51
【问题描述】:

我在我的 MVC 应用程序中使用 Bootstrap 导览功能。为了实施游览,我已经完成了以下引导链接中提到的所有内容

但我的应用程序仍然无法运行游览。

我已经在使用 boostrap,所以我正在使用以下文件

如果您使用的是 Bootstrap,请包含 bootstrap-tour.min.css 和 bootstrap-tour.min.js:

然后是 $(document).ready(function () {

上的索引文件中所需的 Javascript 代码
// Instance the tour
var tour = new Tour({
  steps: [
  {
    element: "#my-element",
    title: "Title of my step",
    content: "Content of my step"
  },
  {
    element: "#my-other-element",
    title: "Title of my step",
    content: "Content of my step"
  }
]});

// Initialize the tour
tour.init();

// Start the tour
tour.start();

如果你们中有人知道这里出了什么问题。

【问题讨论】:

  • 另外,我得到参考错误:页面未定义。

标签: javascript asp.net-mvc twitter-bootstrap


【解决方案1】:

我在 MVC5 中使用引导程序。我相信你已经准备好了一切。 请检查以下地方:

  1. 在bootstrap之后引用了tour css和js,还有jquery;
  2. 确保#my-element 确实存在,alert($("#my-element").html()); 等。
  3. 类似 tr 的东西不能是元素。
  4. 使用tour.restart() 而不是start()。因为你可能在这里遇到了我的问题:Bootstrap tour needs to clear cache to work again

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-09
    • 2013-06-15
    相关资源
    最近更新 更多