【问题标题】:Bootstrap tour n.data(...).tip is not a functionBootstrap tour n.data(...).tip 不是函数
【发布时间】:2020-07-15 22:52:37
【问题描述】:

我正在尝试在我的网站上集成引导程序。

我收到以下错误:

未捕获的类型错误:n.data(...).tip 不是函数

我这样加载我的资源:

<link href="<?=base_url()?>assets/css/bootstrap-tour.min.css" rel="stylesheet"> 
<script src="https://code.jquery.com/jquery-2.2.4.min.js" integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44=" crossorigin="anonymous"></script>
<script defer="defer" src="<?=base_url()?>assets/js/bootstrap-tour.min.js" type="text/javascript"></script>

在我看来,我会这样做:

<script type="text/javascript">
    $(document).ready(function() {
        // Instance the tour
        var tour = new Tour({
            steps: [
                {
                    element: "#adminvolunteers",
                    title: "Title of my step",
                    content: "Content of my step"
                },
                {
                    element: "#adminorganizations",
                    title: "Title of my step",
                    content: "Content of my step"
                }
            ]});

        // Initialize the tour
        tour.init();

        // Start the tour
        tour.start();
    });
</script>

如果我删除脚本加载中的延迟,我会收到以下错误:

未捕获的类型错误:n.popover 不是函数

【问题讨论】:

    标签: jquery twitter-bootstrap bootstrap-tour


    【解决方案1】:

    我使用独立版本解决了同样的问题。 所以我从 github 下载了最新版本 GitHub Repository of Bootstrap-tour 并按以下顺序在我的网页中添加了内容:

    1. boostrap.min.css(我用的是4.1.0版本)
    2. boostrap-tour-standalone.min.css
    3. JQuery(版本 3.2.1)
    4. bootstrap.min.js(4.1.0版)
    5. bootstrap-tour-standalone.min.js

    没关系。

    【讨论】:

    • 使用 bootstrap-tour-standalone-* 和 bootstrap.bundle.min.js 的 bootstrap 4.1.3 为我工作
    • 这适用于引导程序 5 吗?我试过但得到同样的错误
    【解决方案2】:

    我已移至 Bootstrap Tourist,因为其他答案中建议的独立版本导致引导程序(最新版本)出现一些设计问题。

    Bootstrap Tourist 与 Bootstrap Tour 非常相似,并且提供了更多的自定义功能。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-10
      • 1970-01-01
      相关资源
      最近更新 更多