window.onbeforeunload = confirmExit;
function confirmExit()
{
return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?";
}
我试过了,但它甚至没有用。关闭页面时如何进行等待并打开某种优惠?(不是警报,而是html中的消息)
变量停止=真;$('html').mouseleave(function(e){ if (e.offsetY < 0 && stop == true) {
$('#stop-modal').addClass('active'); 停止=假;返回站;} }); 这个选项适合我。用户在页面外显示光标,弹出想要的窗口