如何打开多个弹出窗口?

问题描述:

我有五个链接,每个链接都指向一个页面.

I have five links and each links to a page.

function TohokuImgPopup(url) { 
popupWindow = window.open(
                    url, 'popUpWindow'+randomno, 'height=246,width=228,left=0,top=0,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no')
            }

这是我正在使用的功能.我对5个链接有不同的功能,每个链接都会打开一个新窗口.但是我一次只能打开一个弹出窗口.如何打开多个弹出窗口?

This is the function I am using. I have different function for the 5 links, each opens a new window. But I am only able to open one popup at a time. How can I open multiple popups?

我找到了答案.

<script type="text/javascript">

$(document).ready(


function a1(url) { 
popupWindow1 = window.open(
                    url, 'popUpWindow1', 'height=250,width=234,left=0,top=0,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no')
            }

            function a2(url) { 
popupWindow2 = window.open(
                    url, 'popUpWindow2', 'height=250,width=234,left=0,top=0,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no')
            }

            function a3(url) { 
popupWindow3 = window.open(
                    url, 'popUpWindow3', 'height=308,width=299,left=0,top=0,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=no')
            }
            }
</script>

<a href="JavaScript:a1('images/focus_img1.html');">focus 1</a>
<a href="JavaScript:a2('images/focus_img2.html');">focus 2</a>
<a href="JavaScript:a3('images/focus_img3.html');">focus 3</a>

这些链接将在单独的窗口中打开

These links will be opened in separate windows