Skip to content

Instantly share code, notes, and snippets.

@keithgreer
Created April 11, 2018 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keithgreer/ed2705a9f4d354db14ec7773e2b80357 to your computer and use it in GitHub Desktop.
Save keithgreer/ed2705a9f4d354db14ec7773e2b80357 to your computer and use it in GitHub Desktop.
JavaScript and CSS framework independent cookie pop-up notification for legacy websites.
<!DOCTYPE html>
<html>
<body>
<!-- JavaScript and CSS framework independent cookie pop-up notification for legacy websites. -->
<div id="privacy-pop-up" style="display:none; position:fixed; z-index:9999; bottom:0; left:0; right:0; background:#dc143c; color:#fff; margin:1em; padding:0.5em; text-align:center; ">
<strong>Important information regarding cookies</strong><br>
By using this website, you consent to the use of cookies in accordance with our
<a href="/privacy-policy" style="text-decoration: underline; color:#fff">Privacy Policy</a>.<br>
<a id="exit-popup" style="background:#fff; color:#000; padding:0.25em 0.5em; margin:0.5em; cursor:pointer; font-weight:bold; font-size:90%; ">
Understood, hide this message</a>
</div>
<script>
jQuery(document).ready(function() {
if(localStorage.getItem('pc234978') != '923847'){
jQuery("#privacy-pop-up").delay(1).fadeIn(1000);
localStorage.setItem('pc234978','923847');
} else { console.log("2 " + "returning"); }
jQuery('#exit-popup').click(function(e) // You are clicking the close button
{
jQuery('#privacy-pop-up').fadeOut(1000); // Now the pop up is hiden.
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment