Skip to content

Instantly share code, notes, and snippets.

View monkishtypist's full-sized avatar
👻

Tim Spinks monkishtypist

👻
View GitHub Profile
@monkishtypist
monkishtypist / bs-exit-pop.js
Last active December 13, 2016 20:12
Bootstrap Exit Pop
/* Simple Bootstrap jQuery Exit Pop
* Trigger an existing Bootstrap modal on mouseleave()
*/
/* This first version uses a variable to determine when to trigger pop. */
(function(){
var pop = false; /* it has not pop'd */
jQuery(document).mouseleave(function(){
if(!pop || typeof pop === 'undefined'){
jQuery('#myModal').modal('show'); /* show the modal */