open window problems with firefox

Discussion in 'Javascript' started by Merlin Morgenstern, Sep 28, 2007.

  1. Hi there,

    I do have a JS-function that does open windows in a specific format to
    display small pices of information, like member comments.

    Since a while I have found that this will not work on some systems. For
    example a user told me that since he is on vista the page does not open
    anymore, but the page where he clicked on the link opens the homepage.
    I found for myself, that the pixel specifications do not work on all
    systems. It opens the window way to small now since I upgraded to new
    firefox versions.

    Here is the HTML code:
    <a href="#" onclick="open_center('/dir/popup.php?rid=2521', 600, 400,
    'yes');return false;">test</a>

    This is the JS-function:
    // opens a new window in the middle of the screen without buttons and bars
    //-------------------------------------------------------------------------------------------------------
    function open_center(url,width_,height_,scrollbar,toolbar,menubar,jump) {

    var H_Browserrand = 12;
    var V_Browserrand = 30;
    var H_Aufloesung = screen.availWidth;
    var V_Aufloesung = screen.availHeight;
    var H_Fenstergr = H_Aufloesung-H_Browserrand;
    var V_Fenstergr = V_Aufloesung-V_Browserrand;

    Fensterbreite = width_;
    Fensterhoehe = height_;

    H_offset= (H_Fenstergr-Fensterbreite)/2;
    V_offset= (V_Fenstergr-Fensterhoehe)/2;

    if (V_Fenstergr < Fensterhoehe){ // maybe the client has a smaller
    resulution than the image?
    V_offset = 0;
    Fensterhoehe = V_Fenstergr;
    vlimit= V_Fenstergr;
    }
    else{
    vlimit = 0;
    }

    // if (popup) popup.close();
    var popup =
    window.open(url+'&vlimit='+vlimit+'#'+jump,'Detail','width='+Fensterbreite+',height='+Fensterhoehe+',left='+H_offset+',top='+V_offset+',
    resizable=no,scrollbars='+scrollbar+',toolbar='+toolbar+',status=no,directories=no,menubar='+menubar+',location=no')
    popup.focus();
    return popup;
    };
    //-------------------------------------------------------------------------------------------------------


    Thank you for any help on that. I am pretty stuck with the problem right
    now.

    Best regards,

    Merlin
    Merlin Morgenstern, Sep 28, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CalSun

    Open IE Window from Firefox

    CalSun, Aug 25, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    445
    jasonkester
    Aug 25, 2005
  2. PC HUA
    Replies:
    2
    Views:
    403
    PC HUA
    May 19, 2004
  3. Merlin
    Replies:
    6
    Views:
    104
    Martin Honnen
    Dec 22, 2004
  4. Dominic Tocci
    Replies:
    0
    Views:
    99
    Dominic Tocci
    Jun 30, 2005
  5. Replies:
    1
    Views:
    231
Loading...

Share This Page