Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts

    z-index for popup windows?...

    hey.

    i have a popup window that will be used to show data for every link clicked. all links will open in it. is there a way to specify something like

    onLoad.window.comeToFront

    basically on the second click the info loads in the popup again, but it remains behind the original page. unless people click the popup window on the bottom of the screen, they dont know it has loaded.

    i want it to "pop up" again everytime new data is loaded into it
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    window_object.focus()

  • #3
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    where do i put that? in the head of the HTML file being loaded into the popup?

    <body window_object.focus()>

    ?
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #4
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts
    where do i put that? in the head of the HTML file being loaded into the popup?
    yes

    <body onload="javascript:window.focus();">
    "God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "

  • #5
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    could i modify this script so that it would do that without needing it on every page?

    Code:
    <script type=text/javascript> 
    function newHotProd(urlLoc) {
      _winName = "HTMLview";
      _info  = "toolbar=yes";     // yes|no 
      _info += ",location=no";   // yes|no 
      _info += ",directories=no";// yes|no 
      _info += ",status=no";    // yes|no 
      _info += ",menubar=yes";    // yes|no 
      _info += ",scrollbars=yes";// yes|no 
      _info += ",resizable=yes"; // yes|no 
      _info += ",dependent";     // close the parent, close the popup, omit if you want otherwise 
      DispWin=window.open(urlLoc,_winName,_info);
    } 
          </script>
    using something like "window.onLoad.window.focus()"

    that would make my life a little easier. something like:

    Code:
    <script type=text/javascript> 
    function newHotProd(urlLoc) {
      _winName = "HTMLview";
      _info  = "toolbar=yes";     // yes|no 
      _info += ",location=no";   // yes|no 
      _info += ",directories=no";// yes|no 
      _info += ",status=no";    // yes|no 
      _info += ",menubar=yes";    // yes|no 
      _info += ",scrollbars=yes";// yes|no 
      _info += ",resizable=yes"; // yes|no 
      _info += ",dependent";     // close the parent, close the popup, omit if you want otherwise 
      DispWin=window.open(urlLoc,_winName,_info,window.onLoad.window.focus());
    } 
          </script>
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #6
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    Add

    DispWin.focus()

    to the function


    <script type=text/javascript>
    function newHotProd(urlLoc) {
    _winName = "HTMLview";
    _info = "toolbar=yes"; // yes|no
    _info += ",location=no"; // yes|no
    _info += ",directories=no";// yes|no
    _info += ",status=no"; // yes|no
    _info += ",menubar=yes"; // yes|no
    _info += ",scrollbars=yes";// yes|no
    _info += ",resizable=yes"; // yes|no
    _info += ",dependent"; // close the parent, close the popup, omit if you want otherwise
    DispWin=window.open(urlLoc,_winName,_info);
    DispWin.focus()
    }
    </script>
    Last edited by Mr J; 09-02-2004 at 10:59 PM.
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #7
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    i'll test it once i get home.

    thanks mr J

    also, i've never been able to get this line to work:
    _info += ",dependent"; // close the parent, close the popup, omit if you want otherwise

    i've tried:
    _info += ",dependent=yes"; // close the parent, close the popup, omit if you want otherwise
    and it didnt work.

    any ideas?
    Last edited by canadianjameson; 09-03-2004 at 12:34 AM.
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    That doesn't work in IE. I tested it in Firefox and it works.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #9
    Senior Coder
    Join Date
    Aug 2002
    Location
    UK
    Posts
    2,789
    Thanks
    2
    Thanked 14 Times in 14 Posts
    I have to admit that this is the first time that I have seen this "dependant" attribute.

    Please try the following

    <script type=text/javascript>
    <!--

    DispWin=null

    function newHotProd(urlLoc) {
    _winName = "HTMLview";
    _info = "toolbar=yes"; // yes|no
    _info += ",location=no"; // yes|no
    _info += ",directories=no";// yes|no
    _info += ",status=no"; // yes|no
    _info += ",menubar=yes"; // yes|no
    _info += ",scrollbars=yes";// yes|no
    _info += ",resizable=yes"; // yes|no
    //_info += ",dependent"; // close the parent, close the popup, omit if you want otherwise
    DispWin=window.open(urlLoc,_winName,_info);
    DispWin.focus()
    }


    function closepopup(){
    if(DispWin){
    DispWin.close()
    }
    }


    //Add onunload="closepopup()" to the opening BODY tag


    // -->
    </script>

    Add onunload="closepopup()" to the opening BODY tag
    The silent one.

    The most dangerous thing in the world is an idea.
    The most dangerous person in the world is the one with an idea.

  • #10
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    tested and working nicely, thx mr J.

    also, thx Glenn, good to know
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)

  • #11
    Senior Coder
    Join Date
    Jul 2003
    Location
    My pimped-out igloo in Canadia
    Posts
    1,966
    Thanks
    36
    Thanked 0 Times in 0 Posts
    actually Mr J, in retrospect the dependancy isn't that big of a deal.

    I'll keep the code incase I ever do really require it to close with the parent.

    Thanks again
    Before you criticize someone, you should walk a mile in their shoes. That way, when you criticize them, you're a mile away and you have their shoes :)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •