Есть такой код:
$(document).ready(function() {
$(".mymagicoverbox").click(function() {
$('#myfond_gris').fadeIn(300);
var iddiv = $(this).attr("iddiv");
$('#' + iddiv).fadeIn(300);
$('#myfond_gris').attr('opendiv', iddiv);
return false;
});
$('#myfond_gris, .mymagicoverbox_fermer').click(function() {
var iddiv = $("#myfond_gris").attr('opendiv');
$('#myfond_gris').fadeOut(300);
$('#' + iddiv).fadeOut(300);
});
});
nav {
margin: auto;
width: 800px;
height: 50px;
}
.topnav {
background-color: #fff;
font-size: 16px;
margin-top: 20px;
margin-left: 60px;
z-index: 1000;
}
.topnav a {
color: #000;
text-decoration: none;
text-align: center;
padding: 14px 16px;
font-size: 15px;
}
.topnav .icon {
display: none;
}
.fond {
position: absolute;
padding-top: 0px;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #1289aa;
}
.mymagicoverbox {
display: inline-block;
color: #ffffff;
padding: 10px;
margin: 10px;
cursor: pointer;
font-weight: 300;
font-family: 'Roboto';
-webkit-box-shadow: 0 1px 3px 0 #b5b5b5;
border: 1px solid #a4b9a5;
background-color: #cb2025;
}
#myfond_gris {
display: none;
background-color: #000000;
opacity: 0.7;
width: 100%;
height: 100%;
z-index: 9998;
position: fixed;
top: 0;
bottom: 0;
right: 0;
left: 0;
<script src="https://code.jquery.com/jquery-1.11.1.js"></script>
<nav>
<div class="topnav" id="myTopnav" style="text-align: center;">
<a class="menubutton" href="index.html">Home</a>
<a class="menubutton" href="about.html">About</a>
<a class="menubutton" href="gallery.html">Gallery</a>
<a class="menubutton" href="info.html">Info</a>
<a class="menubutton mymagicoverbox" iddiv="box_1" href="login.php">Login</a>
<a class="menubutton" href="bookings.html">Bookings</a>
</div>
</nav>
<div align="center" class="fond">
<div id="myfond_gris" opendiv=""></div>
<div align="center" style="padding-top:35px;"></div>
</div>
Мне нужно чтобы при нажатии на Login всплывало модальное окно с формами, перепробовал много всего, но всегда есть ошибка, или вообще ничего не отображается или окно очень большое и не уменьшается никак. Подскажите в чем проблема?