Refining the popup?

Discussion in 'Javascript' started by George Hester, Oct 15, 2004.

  1. I have a page that when the user accesses certain links a chromeless window (2) appears and meshes with the newly formed parent window (1). Works nicely in IE 5+ but in IE 6 it's not so good but OK for now.

    Anyway in IE 5;5.5 the chromeless window appears. I have made it so (2) can be moved around on the screen with the mouse and also so that if the parent (1) is minimized leaving (2) only on the desktop when the links in that are clicked, the parent window will focus and that is where the child's (2) link will appear.

    I have one last refinement that I'm hoping someone can shed some light on. I have this in the parent:

    <script type="text/javascript">
    function window_onfocus(){
    if (agilePopper){
    this.blur();
    agilePopper.focus();
    }
    }
    </script>
    <!-- -->
    <script type="text/javascript">
    window.onfocus = window_onfocus;
    </script>

    The idea here is if the parent window is brought to focus the chromless window agilePopper will stay on top and keep the focus. That's fine but here's my trouble. If there is another window open on the desktop then the parent will fall behind that too. So yes it stays behind agilePopper but also goes behind any other window open on the desktop. I'd prefer it stay right behind agilePopper. Sort of like a z-order (increasing left to right): any open window on desktop - Parent - agilePopper.

    If this is not possible using JavaScript that's fine I won't look into it further. But if it is I'd like any suggestions how this might be achieved. Thanks.

    --
    George Hester
    __________________________________
    George Hester, Oct 15, 2004
    #1
    1. Advertising

  2. George Hester

    Ivo Guest

    "George Hester" wrote
    > The idea here is if the parent window is brought to focus the chromless
    > window agilePopper will stay on top and keep the focus. That's fine but
    > here's my trouble. If there is another window open on the desktop then
    > parent will fall behind that too. So yes it stays behind agilePopper but
    > also goes behind any other window open on the desktop. I'd prefer it stay
    > right behind agilePopper. Sort of like a z-order (increasing left to
    > right): any open window on desktop - Parent - agilePopper.
    >
    > <script type="text/javascript">
    > function window_onfocus(){
    > if (agilePopper){
    > this.blur();


    Remove this line. That answers your question.

    > agilePopper.focus();
    > }
    > }
    > </script>
    > <!-- -->
    > <script type="text/javascript">
    > window.onfocus = window_onfocus;
    > </script>


    Merge those two script blocks into one. There is no reason to separate them.

    >

    --
    Ivo
    Ivo, Oct 15, 2004
    #2
    1. Advertising

  3. --
    George Hester
    __________________________________
    "Ivo" <> wrote in message news:416f3474$0$30708$...
    > "George Hester" wrote
    > > The idea here is if the parent window is brought to focus the chromless
    > > window agilePopper will stay on top and keep the focus. That's fine but
    > > here's my trouble. If there is another window open on the desktop then
    > > parent will fall behind that too. So yes it stays behind agilePopper but
    > > also goes behind any other window open on the desktop. I'd prefer it stay
    > > right behind agilePopper. Sort of like a z-order (increasing left to
    > > right): any open window on desktop - Parent - agilePopper.
    > >
    > > <script type="text/javascript">
    > > function window_onfocus(){
    > > if (agilePopper){
    > > this.blur();

    >
    > Remove this line. That answers your question.
    >
    > > agilePopper.focus();
    > > }
    > > }
    > > </script>
    > > <!-- -->
    > > <script type="text/javascript">
    > > window.onfocus = window_onfocus;
    > > </script>

    >
    > Merge those two script blocks into one. There is no reason to separate them.
    >
    > >

    > --
    > Ivo
    >
    >
    >
    >
    >
    >


    New function:

    function window_onfocus(){
    if (agilePopper){
    this.blur();
    //agilePopper.focus();
    }
    }

    It doesn't work. Click on the parent once the title bar of the Parent becomes active and agilePopper stays on top. Click again agilePopper falls behind the Parent. Can't have that either. Mine does keep agilePopper always on top no matter how many times the Parent is clicked.

    The issue is though that the Parent falls behind every open window on the desktop. Not just agilePopper. Thanks.
    George Hester, Oct 15, 2004
    #3
  4. George Hester

    Ivo Guest

    "Ivo" wrote
    > "George Hester" wrote
    > > The idea here is if the parent window is brought to focus the chromless
    > > window agilePopper will stay on top and keep the focus. That's fine but
    > > here's my trouble. If there is another window open on the desktop then
    > > parent will fall behind that too. So yes it stays behind agilePopper but
    > > also goes behind any other window open on the desktop. I'd prefer it
    > > right behind agilePopper. Sort of like a z-order (increasing left to
    > > right): any open window on desktop - Parent - agilePopper.
    > >
    > > <script type="text/javascript">
    > > function window_onfocus(){
    > > if (agilePopper){


    Remove the line below:

    > > this.blur();


    Remove the above line.

    > Remove this line. That answers your question.
    >
    > > agilePopper.focus();
    > > }
    > > }
    > > </script>
    Ivo, Oct 15, 2004
    #4
  5. "Ivo" <> wrote in message news:416f600b$0$62020$...
    > "Ivo" wrote
    > > "George Hester" wrote
    > > > The idea here is if the parent window is brought to focus the chromless
    > > > window agilePopper will stay on top and keep the focus. That's fine but
    > > > here's my trouble. If there is another window open on the desktop then
    > > > parent will fall behind that too. So yes it stays behind agilePopper but
    > > > also goes behind any other window open on the desktop. I'd prefer it
    > > > right behind agilePopper. Sort of like a z-order (increasing left to
    > > > right): any open window on desktop - Parent - agilePopper.
    > > >
    > > > <script type="text/javascript">
    > > > function window_onfocus(){
    > > > if (agilePopper){

    >
    > Remove the line below:
    >
    > > > this.blur();

    >
    > Remove the above line.
    >
    > > Remove this line. That answers your question.
    > >
    > > > agilePopper.focus();
    > > > }
    > > > }
    > > > </script>

    >
    >
    >


    Well not sure what your are referring to. As far as I can tell you suggest the function be this:

    if (agilePopper){
    //this.blur();
    //agilePopper.focus();
    }
    }

    Which will definitely error out and does nothing. I have actually fixed the issue somewhat and have noticed some weird behavior. I'll ask in a differrent thread becasue I think this one has run it's course. I really do not understand your directions. Sorry. Thanks.

    --
    George Hester
    __________________________________
    George Hester, Oct 15, 2004
    #5
    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. =?Utf-8?B?Sm9obiBXYWxrZXI=?=

    Popup Window Popup Timing

    =?Utf-8?B?Sm9obiBXYWxrZXI=?=, Nov 4, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    832
    =?Utf-8?B?Sm9obiBXYWxrZXI=?=
    Nov 4, 2005
  2. dapkniht
    Replies:
    1
    Views:
    1,320
    Eliyahu Goldin
    Mar 8, 2006
  3. Alpha Blue
    Replies:
    25
    Views:
    273
    Robert Klemme
    Feb 5, 2010
  4. Jens Peter Hansen
    Replies:
    7
    Views:
    500
    Randy Webb
    Jun 19, 2004
  5. Oltmans
    Replies:
    2
    Views:
    183
    Tim Chase
    Dec 6, 2012
Loading...

Share This Page