Question:
I would like to make a popup similar to the one from Kabum , but without a form, just an image and the option to close.
I searched and found this code:
<a href="#" onclick="window.open('http://google.com', 'Pagina', 'STATUS=NO, TOOLBAR=NO, LOCATION=NO, DIRECTORIES=NO, RESISABLE=NO, SCROLLBARS=YES, TOP=10, LEFT=10, WIDTH=770, HEIGHT=400');">Clique para abrir a janela POP-up</a>
But it opens a new page and I need it to stay on the same site as the Kabum example.
Answer:
I couldn't see the kabum popup, but from what I understand in your question, you intend to do something like:
var close = document.getElementById('close');
var popup = document.getElementById('popup');
close.addEventListener("click", function() {
popup.style.display = 'none';
});
#popup {
position: absolute;
margin: 0 auto;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-shadow: 0px 0px 50px 2px #000;
padding-bottom: 5px;
}
#close {
width: 100px;
background-color: #cc0033;
color: #ffffff;
border: none;
margin-left: 5px;
}
<div id="popup" class="popup">
<img src="http://dummyimage.com/600x400/000/fff" alt="popup">
<div>
<button id="close">Sair</button>
</div>
</div>
See working on jsfiddle