简体   繁体   English

退出窗口时出现模式弹出窗口-重置一次

[英]Modal Popup on Window exit - resets one time

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... 假设您已经在HTML中创建了模式元素,那么我认为这应该可以实现您想要的...

$(document).mousemove(function(e) {
  if (e.clientY <= 1 && modalShown != 1) {
    modalShown = 1;
    $('#myModal').modal('show');
  }
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM