加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

twitter-bootstrap – Bootstrap tour需要清除缓存再次工作

发布时间:2020-12-18 00:17:39 所属栏目:安全 来源:网络整理
导读:我正在尝试在我的Web应用程序中使用bootstrap tour.前5分钟一切正常,我看到了弹出的步骤,第一次也是唯一一次.然后弹出窗口就消失了.我尝试了很多方法,甚至重新启动了电脑,事实证明,每次我清除浏览器缓存,它都可以工作一次.然后我需要再次清除缓存. 代码如下
我正在尝试在我的Web应用程序中使用bootstrap tour.前5分钟一切正常,我看到了弹出的步骤,第一次也是唯一一次.然后弹出窗口就消失了.我尝试了很多方法,甚至重新启动了电脑,事实证明,每次我清除浏览器缓存,它都可以工作一次.然后我需要再次清除缓存.

代码如下所示:

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",自动保存2",position: "n" }
];

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

任何想法?谢谢.

解决方法

该问题与库配置有关,因为它默认将数据存储到DOM存储接口.

DOCS

选项:存储

默认值:window.localStorage

描述:

The storage system you want to use. Could be the objects window.localStorage,window.sessionStorage or your own object.
You can set this option as false to disable storage persistence (the tour starts from beginning every time the page is loaded).

固定

var tour = new Tour({
    steps: window.steps,storage: false
});

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读