简体   繁体   English

在提交时打开多个窗口

[英]Open Multiple windows on Submit

This is how far I have gotten to. 这就是我已经走了多远。 The form is just a simple checkbox with urls in each checkboxes value. 表单只是一个简单的复选框,每个复选框的值中都包含url。 This works half the way. 这工作一半。 I can't manage to resize the windows neither in Chrome or Firefox. 在Chrome或Firefox中,我都无法调整窗口大小。

$(document).ready(function(){
$("form").submit(function(){

    $('#goTo input:checked').each(function(count){

        var goTo;
        var wWidth; 
        var wHeight;
        var windowSize;
        i = 25 * count;

        goTo = $(this).val();
        wWidth = $(window).width() - $(window).width() / 2;
        wHeight = $(window).height() - i;
        windowSize = "width="+wWidth+"height="+wHeight;

        window.open(goTo, 'title', windowSize);                 
    });


    return false;

});
});

Adding resizable=1 should do it: 添加resizable=1应该可以做到:

window.open(goTo, 'title', windowSize + ',resizable=1');

But you also have an error in setting the windowSize - it's missing a , : 但你也必须在设定的误差windowSize -缺少一个,

//       missing comma here ->
windowSize = "width="+wWidth+",height="+wHeight;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM