Reputation: 191
I would like to use only one time modal when a user leaves on the Window.
$(document).mousemove(function(e) {
if (e.clientY <= 1) {
//Modal
}
});
Let me know how can I create it.
Upvotes: 0
Views: 25
Reputation: 36
Assuming that you already have the modal element created in your HTML then I think this should do what you want...
$(document).mousemove(function(e) {
if (e.clientY <= 1 && modalShown != 1) {
modalShown = 1;
$('#myModal').modal('show');
}
});
Upvotes: 1