I managed to create my own Full page modal successfully, but now I want to enhance it with an animation. I am attempting to use animate.css to add animation effects such as zoomIn or zoomOut, but it's not working as expected.
Here is the link to my JSFiddle showing what I have tried. Any assistance would be greatly appreciated.
HTML:
<div class="am-modal" id="examples-modal">
<a href="javascript:void(0);" class="am-colse"> Back</a>
<div class="head">
Trying Modal with zoonIn and out effect
</div>
</div>
<a href="javascript:void(0)" class="am-modal-trigger" data-am-target="#examples-modal">Modal Trigger</a>
CSS:
.am-modal {
display: none;
width: 100%;
position: absolute;
top: 0px;
left: 0px;
background-color: #2c3e50;
padding: 20px;
}
.am-modal a{
float: float;
}
.head{
margin-top: 40px;
font-size: 25px;
color: #fff;
text-align: center;
}
JQuery:
$(document).ready(function(e) {
resizeDiv();
window.onresize = function(event) {
resizeDiv();
}
function resizeDiv() {
vpw = $(window).width();
vph = $(window).height();
$('.am-modal').css('height', vph + "px");
}
$('.am-modal-trigger').on('click', function() {
var target = $(this).data('am-target');
$(target).css('display','block');
$(target).addClass('zoomIn');
});
$('.am-colse').on('click', function() {
$(this).parent().removeClass('zoomIn').addClass('zoomOut');
$(this).parent().css('display','none');
});
});