1. window.onbeforeunload = function() {
  2.             var n = window.event.screenX - window.screenLeft;
  3.             var b = n > document.documentElement.scrollWidth-20;
  4.             if(b && window.event.clientY < 0 || window.event.altKey){
  5.                 alert("这是一个关闭操作而非刷新");
  6.                 window.event.returnValue = ""; //此处放你想要操作的代码
  7.             }else{
  8.                 alert("这是一个刷新操作而非关闭");
  9.             }
  10.         }

09-07 06:56
查看更多