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.
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');
}
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.