Twitter bootstrap 引导程序cookie结束
我正在尝试将cookie添加到巡更中,以便在巡更结束时,在您重新访问页面时不再显示cookie。这是我的代码:Twitter bootstrap 引导程序cookie结束,twitter-bootstrap,cookies,Twitter Bootstrap,Cookies,我正在尝试将cookie添加到巡更中,以便在巡更结束时,在您重新访问页面时不再显示cookie。这是我的代码: $("#dialog").dialog({stack:true}); var t = new Tour({ backdrop: true, onShown: function(tour) { var stepElement = getTourElement(tour); $(stepElement).after($('.tour-step
$("#dialog").dialog({stack:true});
var t = new Tour({
backdrop: true,
onShown: function(tour) {
var stepElement = getTourElement(tour);
$(stepElement).after($('.tour-step-background'));
$(stepElement).after($('.tour-backdrop'));
}
});
t.addStep({
element: "#red",
title: "red",
content: "Content"
});
t.addStep({
element: "#red-stripe",
title: "stripes",
content: "Content"
});
t.addStep({
element: "#p",
title: "Title",
content: "Content"
});
$.cookie('endcookie', 'end', { expires: 7 });
t.restart();
function getTourElement(tour){
return tour._steps[tour._current].element
}
这不起作用应该不需要使用cookie。引导巡更使用浏览器的本地存储来确保用户不会多次看到巡更 再次调用
tour.start()
之前,请使用一个tour.restart()
。这对我来说解决了重新开放的问题