2011-05-27 14 views

cevap

0

, sizin için iyi olabilir:

http://roneiv.wordpress.com/2008/01/18/open-a-popup-window-in-javascript-with-windowopen-crossbrowser-solution/

var myPopupWindow = ''; 
function openPopupWindow(url, name, width, height) 
{ 
    //Remove special characters from name 
    name = name.replace(/\/|\-|\./gi, ""); 

    //Remove whitespaces from name 
    var whitespace = new RegExp("\\s","g"); 
    name = name.replace(whitespace,""); 

    //If it is already open 
    if (!myPopupWindow.closed && myPopupWindow.location) 
    { 
     myPopupWindow.location.href = encodeUrl(url); 
    } 
    else 
    { 
     myPopupWindow= window.open(encodeUrl(url),name, "location=no, scrollbars=yes, resizable=yes, toolbar=no, menubar=no, width=" + width + ", height=" + height); 
     if (!myPopupWindow.opener) myPopupWindow.opener = self; 
    } 

    //If my main window has focus - set it to the popup 
    if (window.focus) {myPopupWindow.focus()} 
} 
0

Eğer pop-up pencere adında mü? Chrome'un, zaten açmış olduğu pencereleri hatırlamak için bir mantığı olduğunu ve bu durumun pop-up'larınıza müdahale edebileceğini, dolayısıyla ilk seferde doğru şekilde çalıştığını tahmin ediyorum. Pop-up pencereyi denememeyi tavsiye ederim.

İlgili konular