I am currently facing an issue with a simple modal window that opens when a link is clicked and should close when the user clicks on the close button, represented as a red rectangle in my fiddle.
You can access my fiddle through this link
Below is the relevant code snippet :
// prize modal
$('.modal').on('click',function(){
if(!$('#prize-modal').hasClass('open')){
$('#prize-modal').css('opacity',0.7);
if($.browser.msie){
$('#prize-modal').css('opacity','null').css('display','block').addClass('open');
}else {
$('#prize-modal').css('opacity',0).css('display','block').addClass('open').stop().animate({opacity: 1}, 500);
}
}
return false;
});
// .close the class that you want to trigger the modal clossing
$('.close').on('click',function(){
if($.browser.msie){
$('.open').css('opacity','null').css('display','none').removeClass('open');
}else {
$('.open').stop().animate({opacity: 0}, 500,function()
{
$('.open').css('display','none').removeClass('open');
});
}
});
I am struggling to understand why the functionality of the "close" button is not working.