if(event.clientY < 0)
 {  
      window.open("close.asp","","top=1,left=1,width=1,height=1");
   }

解决方案 »

  1.   

    在框架网页里不一定有 body 这个对象, 所以就不一定会有 document.body.clientWidth
    所以你这个判断式就不一定成立而失效!!
      

  2.   

    <script language="javascript">
    function show()
    {
       if(window.screenLeft>=10000 && window.screenTop>=10000)
      {  
          window.open("close.asp","","top=1,left=1,width=1,height=1");
       }
    }
    </script>
    <HTML>
    <frameset framespacing="0" rows="100,*,26" border="0" frameborder="0" name="abc" onunload="show()">
    </frameset>
    </HTML>
      

  3.   

    <html>
      <head>
      <title>框架网页的关闭事件捕捉</title>
        <script language="javascript">
        /*@cc_on @*/
        /*@if (@_win32 && @_jscript_version>=5)
        function window.onbeforeunload()  //author: meizz
        {
          var b = window.event.clientX > window.frameTop.document.body.clientWidth - 20;
          //注意 window.frameTop 里的 frameTop 与框架里的横向框架页 name 对应
          if(b && window.event.clientY < 0 || window.event.altKey)
          {
            window.event.returnValue = "";
          }
        }
        @end @*/
        </script>
      </head>
    <frameset rows="100, *">
      <frame name=frameTop>
      <frameset cols="160, *">
        <frame name=frameLeft>
        <frame name=frameRight>
      </frameset>
      <noframes>
        <body>
          <h2 align="center">对不起!你的浏览器不支持框架网页</h2>
        </body>
      </noframes>
    </frameset>
    </html>