showx = event.screenX - event.offsetX ; // 横向的位置;
showy = event.screenY - event.offsetY ; // 纵向的位置;
window.open("a.asp",'','left='+showx+',top='+showy)
showx 、showy 需要进行一点调整

解决方案 »

  1.   


    top= ( document.body.clientHeight - 弹出的窗口高)/2
    left= ( document.body.clientWidth  -弹出的窗口宽)/2
      

  2.   

    <script language="JavaScript">
    <!--var a = window.open("about:blank","","menubar=no;toolbar=no;")a.moveTo((screen.width-a.document.body.clientWidth)/2,(screen.height-a.document.body.clientHeight)/2);//-->
    </script>
      

  3.   

    判断滚动条top= ( document.body.clientHeight - 弹出的窗口高)/2+滚动条的高
    left= ( document.body.clientWidth  -弹出的窗口宽)/2
      

  4.   

    //OpenWindow(文件名,窗口名称,宽度,高度);
    function OpenWindow(url,winname,width,height)
    {
    var sw=screen.width;
    var sh=screen.height;
    var sl=parseInt((sw-width)/2);
    var lt=parseInt((sh-height)/2);
    window.open(url,winname,'width='+width.toString()+',height='+height.toString()+',left='+sl.toString()+',top='+lt.toString()+',toolbar=no,menubar=no,scrollbars=no,status=no');
    }