Authored by 张孝茹

根据cooKies去除下载条

... ... @@ -6,6 +6,7 @@ let indexObj = {
this.lazyLoad();
this.resizeInit();
this.resize();
this.downShow();
},
lazyLoad: function() {
lazyload($('img.lazy'), {
... ... @@ -31,6 +32,28 @@ let indexObj = {
$(window).resize(function() {
_this.resizeInit();
});
},
cookie: function(name) {
let cookies = document.cookie,
cookieVal;
if (cookies) {
cookies = cookies.split(';');
for (let i = 0; i < cookies.length; i++) {
if (cookies[i].indexOf(name) > -1) {
cookieVal = decodeURIComponent($.trim(cookies[i].replace(name + '=', '')));
break;
}
}
}
return cookieVal;
},
downShow: function() {
if (this.cookie('ignoreDownload') == 1) {
$('.download').remove();
}
}
};
... ...