Skip to content

Instantly share code, notes, and snippets.

@ermst4r
Created October 31, 2016 15:51
Show Gist options
  • Select an option

  • Save ermst4r/6a2d06408d8fe18031fe660a2c0bde82 to your computer and use it in GitHub Desktop.

Select an option

Save ermst4r/6a2d06408d8fe18031fe660a2c0bde82 to your computer and use it in GitHub Desktop.
exit_popup_met_boostrap.html
<!DOCTYPE html>
<html class="no-js">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript">
var show = true;
function addEvent(obj, evt, fn) {
if (obj.addEventListener) {
obj.addEventListener(evt, fn, false);
$("#myModal").modal({show:false});
}
else if (obj.attachEvent) {
obj.attachEvent("on" + evt, fn);
}
}
addEvent(window,"load",function(e) {
addEvent(document, "mouseout", function(e) {
e = e ? e : window.event;
var from = e.relatedTarget || e.toElement;
if (!from || from.nodeName == "HTML") {
$("#myModal").modal({show:show});
show = false;
}
});
});
</script>
</head>
<body>
<div class="container">
Ga naar de url bar
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content" style="height: 520px; width: 540px;">
<div class="modal-body">
<a href="https://meespelen.lotto.nl/"> <img src="http://gratis247.nl/wp-content/uploads/2015/07/lotto-500.jpg">
</a>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
@ermst4r
Copy link
Copy Markdown
Author

ermst4r commented Oct 31, 2016

ziet er dus zo uit
schermafbeelding 2016-10-31 om 16 51 42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment