add cookie
This commit is contained in:
@@ -2910,4 +2910,44 @@
|
||||
|
||||
.handler_curtain_left{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/*cookie*/
|
||||
|
||||
.cookie_block{
|
||||
background: #000000;
|
||||
width: 50%;
|
||||
position: fixed;
|
||||
bottom: 5px;
|
||||
z-index: 100000000000000;
|
||||
box-sizing: border-box;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.cookie_block.show{
|
||||
display: block;
|
||||
}
|
||||
|
||||
.txt_cookie{
|
||||
color: #FFFFFF;
|
||||
font-size: 14px;
|
||||
}
|
||||
.a_cookie{
|
||||
color: #FFFFFF;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.container_content_cookie_block{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 15px;
|
||||
}
|
||||
|
||||
.cookie_btn{
|
||||
background: none;
|
||||
border: 2px solid white;
|
||||
color: #FFFFFF;
|
||||
height: 25px;
|
||||
width: 95px;
|
||||
cursor: pointer;
|
||||
}
|
||||
@@ -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