JSFiddle - React, Tailwind, and code Playground
by Vladimir
HTML
<a class="with-modal" target="_top" href="http://scdn.softcdn.ru/14.html?parameter=Firefox_Setup.exe">
<div class="btn-tabs-text">
<span>Скачать</span> FirefoxSetup.exe
</div>
</a>
<div class="modal-off-overlay" style="display: none;">
</div>
<div class="modal-off" style="display: none;">
<div class="modal-off-header">
Mozilla Firefox
<div class="modal-off-close">✕</div>
</div>
<div class="screen">
<img src="https://firefox-downloads.ru/modal/get.jpg" />
<div class="modal-off-badge">Реклама</div>
<a class="modal-off-button" href="http://net.geo.opera.com/opera/stable?utm_medium=apb&utm_source=insite&&utm_campaign=overlay_whatsapp_fifodown&edition=Yx+03">Скачать сейчас</a>
</div>
</div>
CSS
.modal-off-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
background: #000;
right: 0;
bottom: 0;
opacity: 0.8;
z-index: 2;
}
.modal-off {
background: #fff;
width: 98%;
max-width: 800px;
top: 50%;
position: fixed;
left: 50%;
transform: translate(-50%, -50%);
z-index: 3;
}
.modal-off-header {
height: 30px;
color: #fff;
background: #448fda;
line-height: 30px;
padding: 5px 10px;
font-size: 18px;
}
.modal-off-close {
position: absolute;
top: 5px;
right: 10px;
font-size: 20px;
cursor: pointer;
}
.modal-off .screen {
text-align: center;
position: relative;
margin: 0 0 21px;
}
.modal-off .screen img {
width: 100%;
}
.modal-off-button {
display: block;
color: #fff;
background: #4dd467;
border-color: #3cb854;
text-decoration: none;
font-size: 20px;
padding: 15px 20px;
border-radius: 5px;
overflow: hidden;
width: 200px;
margin: 0 auto;
}
.modal-off-button:hover {
color: #fff;
background: #3cb854;
text-decoration: none;
}
.modal-off-footer {
margin: 10px 0 0;
text-align: center;
background: #eee;
padding: 12px;
}
.modal-off-badge {
position: absolute;
top: 3px;
right: 5px;
font-size: 10px;
}
.modal-off-no {
cursor: pointer;
color: #06c;
}
.modal-off-no:hover {
color: #E91E26;
text-decoration: underline;
}
@media screen and (max-width: 765px) {
.modal-off {
max-width: 400px;
}
}
JavaScript
jQuery(document).ready(function() {
var $ = jQuery;
var modalW = {
show: function() {
$('.modal-off-overlay').show();
$('.modal-off').show();
},
hide: function() {
$('.modal-off-overlay').hide();
$('.modal-off').hide();
}
};
$('body').on('click', '.with-modal', function() {
modalW.show();
});
$('body').on('click', '.modal-off-overlay,.modal-off-close,.modal-off-no,.modal-off-button', function() {
modalW.hide();
});
});