参考
http://community.csdn.net/Expert/topic/3854/3854721.xml?temp=.1445429

解决方案 »

  1.   

    <script language="javascript">
    window.onbeforeunload = function()  //author: meizz
    {
      var n = window.event.screenX - window.screenLeft;
      var b = n > document.documentElement.scrollWidth-20;
      if(b && window.event.clientY < 0 || window.event.altKey)
      {
        window.event.returnValue = "";  //这里可以放置你想做的操作代码
      }
    }
    </script>
      

  2.   

    以下代码只兼容IE
    window.onunload=function(){
    if(window.screenLeft>10000 || window.screenTop>10000){
    alert("这是关闭")
    }else{
    alert("这是刷新")
    }
    }