Modal repentido o primeiro resultado sql
Modal repentido o primeiro resultado sql
by Angelo Rogério Rubin
HTML
<div class="ver_detalhes openBox" name="box1" id="1">+</div>
<div class="fullScreen">
<div class="dialog" id="box1">
<?php echo $compara_modal;?>
<a class="button">OK</a>
</div>
</div>
CSS
.fullScreen {
width: 100%;
height: 100%;
background: rgba(0,0,0,0.4);
display: block;
position: absolute;
top: 0;
left: 0;
display: none;
}
.dialog {
position: relative;
background: rgba(0,0,0,1.0);
color: #eee;
width: 500px;
height: 200px;
border-radius: 10px;
margin: 0 auto;
padding: 15px;
z-index: 999;
box-sizing:border-box;
-moz-box-sizing:border-box;
display: none;
font-size: 14px;
}
.button {
position: absolute;
display: block;
bottom: 15px;
background: #cc0000;
color: #fff;
width: 100px;
border-radius: 4px;
margin-left: 185px;
padding: 5px;
text-align: center;
box-sizing:border-box;
-moz-box-sizing:border-box;
font-size: 13px;
}
.button:hover {
background-color: #ee0000;
cursor: pointer;
}
JavaScript
$(function(){
$(".openBox").click(function(){
var windowName = $(this).attr("name"),
height = ($(window).height() - $('.dialog').outerHeight())/2;
$(".fullScreen").fadeIn("fast");
$("#"+windowName).css("margin-top",height+"px").fadeIn("fast");
});
$(".button").click(function(){
$(".fullScreen, .dialog").fadeOut("fast");
});
});