Bootstrap Tour 需要清除缓存才能再次工作 [英] Bootstrap tour needs to clear cache to work again

查看:23
本文介绍了Bootstrap Tour 需要清除缓存才能再次工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 Web 应用程序中使用引导程序.在前 5 分钟一切正常,我第一次也是唯一一次看到了弹出步骤.然后弹出窗口后来消失了.尝试了很多方法甚至重启了电脑,结果是每次清空浏览器缓存都生效一次.然后我需要再次清除缓存.

I am trying to use bootstrap tour in my web application. Everything worked fine at the first 5 minutes and I saw the popup steps, the first time and the only time. Then the popups just disappeared later. I tried many methods even restarted the pc, and it turned out that every time I clear the browser cache, it works once. Then I need to clear the cache again.

代码如下:

    helpButton.click(function() {
    if (window.steps === undefined)
        return;
    alert("element: " + window.steps[0].element + ", title: " + window.steps[0].title + ", content: " + window.steps[0].content + ", val: " + $(window.steps[0].element).val());
    var tour = new Tour({
        steps: window.steps
    });
    tour.init();
    tour.start();
    alert("finished.");
});

步骤如下:

<script type="text/javascript">
var steps = [
    { element: "#choose-team", title: "快速编辑", content: "可以在这里直接编辑标题,自动保存", position: "n" },
    { element: ".hidden-editor:first", title: "快速编辑2", content: "可以在这里直接编辑标题,自动保存2", position: "n" }
];

  1. 所有的alert()都很好,步数数据也很好(这就是为什么它至少可以运行一次).
  2. 他们网站上的所有官方示例都很好.
  3. IE 和 Chrome 在我的 PC 上都存在同样的问题.
  4. Tour js 和 css 完好无损(从 Bootstraptour.com 下载).

有什么想法吗?谢谢.

推荐答案

我刚刚找到了另一种解决问题的方法,如果存储是必须的.使用 restart() 而不是 start() 也可以解决问题.还有一个start(true)而不是restart(),但是直接跳到了最后一步.

I Just found another way to walk around the problem, if storage is a must. Use restart() instead of start() can solve the problem as well. And there is a start(true) instead of restart(), but it jump to the last step directly.

听起来,默认情况下,此游览旨在用作一次性游览.例如,当您网站上的某些内容更新时,导览应自动运行一次以显示更新,并且不会再次打扰用户.

It sounds like this tour, be default, is designed to work as an one-time tour. For example, when something on your website is updated, the tour should automatically run once to show the update, and will will never bother the user again.

要使其成为可重复的游览,请通过选项中的storage: false"禁用存储,或使用 restart() 而不是 start().

To make it a repeatable tour, disable the storage by "storage: false" in option, or use restart() instead of start().

这篇关于Bootstrap Tour 需要清除缓存才能再次工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆