I'm creating my website, and I created a basic popup
with html
, css3
, javascript
and would like to know how do I get the cookie
of the user and display the popup
only one instead on my site, follow the syntax below.
window.onload = function() {
function fechar() {
var popup = document.getElementById('popup');
var cor = document.getElementById('cor');
popup.style.display = "none";
cor.style.display = "none";
}
}
.popup {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
width: 500px;
height: 300px;
padding: 15px;
border: solid 1px black;
background: url(https://www.google.com.br/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png) no-repeat;
z-index: 2;
display: none;
}
.popup p {
position: relative;
top: -30px;
left: 0;
color: white;
}
.popup p a {
position: relative;
top: 68px;
left: 178px;
text-decoration: none;
color: black;
}
img[alt="fechar"] {
height: 26px;
width: 28px;
position: relative;
left: 454px;
top: -14px;
}
<body>
<div class="popup" id="popup">
<a href="javascript:fechar()">
<img src="img/fechar.png" alt="fechar">
</a>
<p>Inscreva-se em meu canal do youtube Leonardo Santos link abaixo</p>
<p><a href="#" target="_blank">clique aqui</a>
</p>
</div>