Created
March 18, 2022 21:42
-
-
Save liveaverage/271d4b2986e15f6e8203edd4f234074a to your computer and use it in GitHub Desktop.
Terms and Conditions Modal Dialog
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-modal/0.9.1/jquery.modal.min.js"></script> | |
<link rel="stylesheet" href="https://raw.githack.com/liveaverage/jquery-modal/master/jquery.modal.css" /> | |
<div id="tnc" class="modal" style="display: none;" > | |
<p>Sign your life away</p> | |
<div><a href="#" class="btn float-right" onclick="acceptTerms()" rel="modal:close">Accept</a></div> | |
<div><a href="#" class="btn btn-neutral float-left">Decline</a></div> | |
</div> | |
<script type="text/javascript" charset="utf-8"> | |
$(document).ready(function() { | |
if(localStorage.getItem('tcstate') != 'shown'){ | |
$('#tnc').modal({ | |
escapeClose: false, | |
clickClose: false, | |
showClose: false, | |
fadeDuration: 200 | |
}); | |
} | |
}); | |
function acceptTerms(){ | |
localStorage.setItem('tcstate','shown'); | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment