Created
November 1, 2016 08:35
-
-
Save sokoljr/15e75f7c906c849f068a0653dd35eba9 to your computer and use it in GitHub Desktop.
Modal window whith cookie
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(window).load(function() { | |
var hideTheModal = $.cookie('hideTheModal'); | |
if(hideTheModal == null) { | |
$('#overlay').fadeIn(400,function() { | |
$('#modal_form').css('display', 'block').animate({opacity: 1, top: '50%'}, 200); | |
}); | |
$('#modal_close, #modal_success').click( function() { | |
var date = new Date(); | |
var minutes = 1; | |
date.setTime(date.getTime() + (minutes * 60 * 1000)); | |
$.cookie('hideTheModal', 'true', { expires: date }); | |
$('#modal_form').animate({opacity: 0, top: '45%'}, 200, function() { | |
$(this).css('display', 'none'); | |
$('#overlay').fadeOut(400); | |
}); | |
}); | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment