js

用windows.open弹出窗体后,再在已弹出的窗体的按钮事件下,再写windows.open再弹出一个窗体,如何控制第2个窗体的大小?第一个窗体我可以控制,第二个窗体大小不能改变,默认成了第一个的大小

解决方案 »

  1.   

    第一个的窗口大小是你指定的,第二个窗体弹出时,窗体的width和height你没再次指定而是沿用第一个窗体的参数,自然不会改变。你可以重新指定!
      

  2.   

    可以指定的呀<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>index.htm</title>
    <script>
    function o(){
    window.open("index.htm","","height="+document.getElementById("h").value+",width="+document.getElementById("w").value);
    }
    </script>
    </head><body>
    <input type=text id=w value="">
    <input type=text id=h value="">
    <input type=button value="open window" onclick="o()">
    </body></html>
      

  3.   

    第一个窗体代码
    window.open('NewPension.aspx?e_name=" + Server.UrlEncode(e_name) + "&c_id=" + c_id + "&e_id=" + e_id + "&client_name=" + Server.UrlEncode(client_name) + "&client_id=" + client_id + "&bank_flag="+bank_flag+"&flag=0', null, 'width=600,height=500,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,left=450px,top=180px')";第二个     Response.Write("<script> window.open('makeup.aspx?e_id=" + e_id + "&e_name=" + Server.UrlEncode(e_name) + "&client_id=" + client_id + "&client_name=" + Server.UrlEncode(client_name) + "&start_time=" + time + "&s_id=02&s_name=" + Server.UrlEncode("社保") + "&PenB=" + PenB + "&MedB=" + MedB + "&xy=" + DropDownList3.SelectedItem.Value + "&HeatingB=" + HeatingB + "', null, 'width=800px,height=500px,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,left=450px,top=180px')</script>");这样不好使
      

  4.   

    第一个窗体代码
    window.open('NewPension.aspx?e_name=" + Server.UrlEncode(e_name) + "&c_id=" + c_id + "&e_id=" + e_id + "&client_name=" + Server.UrlEncode(client_name) + "&client_id=" + client_id + "&bank_flag="+bank_flag+"&flag=0', null, 'width=600,height=500,status=no,toolbar=no,menubar=no,location=no,scrollbars=no,left=450px,top=180px')";第二个     Response.Write("<script> window.open('makeup.aspx?e_id=" + e_id + "&e_name=" + Server.UrlEncode(e_name) + "&client_id=" + client_id + "&client_name=" + Server.UrlEncode(client_name) + "&start_time=" + time + "&s_id=02&s_name=" + Server.UrlEncode("社保") + "&PenB=" + PenB + "&MedB=" + MedB + "&xy=" + DropDownList3.SelectedItem.Value + "&HeatingB=" + HeatingB + "', null, 'width=800px,height=500px,status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no,left=450px,top=180px')</script>");这样不好使
      

  5.   

    window.open(url,name,features);楼主你的open函数的第二个参数不要使用相同的名称,就是设置不一样name,也不要都为null,这样会打开两个窗口,如果名称相同的话第二个窗口就会把第一个窗口覆盖掉而不是打开一个新的窗口。