add cookie
This commit is contained in:
@@ -11,6 +11,7 @@ window.onload = function (){
|
||||
middleWareJS()
|
||||
openOrCloseCurtainSupportChat()
|
||||
openOverlayOrClose()
|
||||
checkStateCookie()
|
||||
}
|
||||
//
|
||||
|
||||
@@ -151,3 +152,17 @@ function scroll_ev (event,el){
|
||||
}
|
||||
}
|
||||
|
||||
function checkStateCookie () {
|
||||
if (window.document.cookie.includes("allow_cookie=true")){
|
||||
document.querySelector(".cookie_block").classList.remove("show")
|
||||
}
|
||||
}
|
||||
|
||||
function setCokie () {
|
||||
let date = new Date();
|
||||
let days = 182;
|
||||
date.setTime(+ date + (days * 86400000));
|
||||
window.document.cookie = "allow_cookie=true" + "; expires=" + date.toGMTString() + "; path=/";
|
||||
document.querySelector(".cookie_block").classList.remove("show")
|
||||
return value;
|
||||
}
|
||||
Reference in New Issue
Block a user