function setCookie(key, value, expires) {
var cookieStr = key + "=" + value;
if (expires) {
cookieStr += "; " + "max-age" + "=" + 1;
}
document.cookie = cookieStr;
}
function getCookie(sName) {
var aCookie = document.cookie.split("; ");
for (var i = 0; i < aCookie.length; iPP) {
var aCrumb = aCookie[i].split("=");
if (sName == aCrumb[0])
return unescape(aCrumb[1]);
}
return null;
}
$(function(){
var act = getCookie("act");
//
if (act == "freshen") {
$(".loader-container,.p1,.p2,.p3").addClass("none")
swiperInit()
}
else {
$(".p1,.p2,.p3,.loader-container").removeClass("none")
}
$(".btn-goLottery").on("click", function () {
var exp = new Date();
exp.setTime(exp.getTime() + 1000);
exp = exp.toGMTString();
setCookie("act", "freshen", exp);
window.location.href = url + "/default/index"
});
})
now it"s like this: I click on the lottery store cookie to jump to cookie to judge that some part of the page is hidden in the value display
, but now there will be occasional failures on the real machine, that is, refreshing the part that you don"t want to hide