Skip to content

Instantly share code, notes, and snippets.

@joshuacharleslake
Created August 3, 2015 16:19
Show Gist options
  • Save joshuacharleslake/931ce4cd3ce70e029cde to your computer and use it in GitHub Desktop.
Save joshuacharleslake/931ce4cd3ce70e029cde to your computer and use it in GitHub Desktop.
Pop up box which will display after a time limit.
<div id="popupbox">
<a id="closebox" onclick="document.getElementById('popupoffer').style.display = 'none';">&times;</a>
</div>
<script type="text/javascript">
function show() {
document.getElementById("popupbox").style.display = "block";
}
$(function() {
setTimeout(show, 300);
});
</script>
<style>
#popupbox { background: rgba(255, 255, 255, .95); width:350px; text-align: center; height: auto; margin: 0 auto; z-index: 999999; display: none; color: #000; position: fixed; top: 50px; margin-left: auto; margin-right: auto; left: 0; right: 0; padding: 10px;
}
#popupbox #closebox { color: #777; font-size: 2.2em; text-decoration: none; display: block; float: right; }
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment