jsp页面很多弹出窗口,怎么让弹窗每次显示都是在页面的正中间,弹窗老是一会跑页面的最下边,一会跑最上边

解决方案 »

  1.   

    window.open ('page.html', 'newwindow', 'height=100, width=400, top=0, left=0, toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no') 
    你可以调整top与left的值来控制窗口位置
      

  2.   

    可以在写小窗口的样式的时候这样写:
      position: absolute;
      top:200;
      left:400;
    根据你的需求调整top和left的数值就可以,这个我用过的
      

  3.   


    var width = 800;
    var height = 330;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    function MM_openBrWindow(theURL,winName) { 
    var windowFeatures = "width=" + width + ",height=" + height + ",status=no,resizable=yes ,left=" + left + ",top=" + top + ",screenX=" + left + ",screenY=" + top;
    window.open(theURL,winName,windowFeatures);
    }