I am struggling with getting my modal to disappear permanently when the checkbox "Don't show me again" is checked and the button "Close" is pressed. I have attempted using jquery-cookie, but so far I have been unsuccessful in achieving this desired behavior.
Despite checking the checkbox, pressing the 'close' button, and reloading the page, the modal keeps reappearing.
To view the code snippet, click here: https://codepen.io/anon/pen/WBPLEK
Here is the JavaScript portion of the code:
jQuery(document).ready(function($) {
if ($.cookie('cacher-modal')) {
$("#popupMaintenanceModal").remove();
}
else {
$('#popupMaintenanceModal').modal('show');
}
if ($('#popupMaintenanceCheckbox').is(':checked')) {
$(".btn-maintenance").click(function () {
$("#popupMaintenanceModal").remove();
$.cookie('cacher-modal', true);
});
}
});