Results 1 to 3 of 3

Thread: fixed popup

  1. #1
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default fixed popup

    hi all,

    i have a issue with a pop up window. when the index file loads i open a pop up window which is another html file. while clicking on the main window the pop window goes under the main window. how to make the pop window always stay over the main window? can anyone help me in this.

    thanks in advance

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, the pop up is loosing focus. You could, on the page in the pop up:

    Code:
    onblur=function(){self.focus();};
    But, that will override the click actions on the main page. If instead, when you opened the pop up, you assigned it a variable, like (on the main page):

    Code:
    var bob=window.open('pop.htm','','width=300, height=300, top=200, left=200');
    You could then construct javascript events on the main page that would execute and then return focus to the pop up:

    HTML Code:
    <span onclick="alert('here');bob.focus();">alert</span>
    But, if both pages were opened at once from another page, it gets tricky and I'm not sure that the variable for the pop up can be easily passed to the new main page, unless the opening page remains open. It can in FF, but not in others. Others can use code like so (on the pop up):

    Code:
    onblur=function(){setTimeout('self.focus()',1000);};
    but FF cannot. Code branching might be able to decide which method to use. At his point though, if this is the situation, you might consider, instead of opening a pop up, using a DHTML pop up division.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks...that helped a lot

Bookmarks

Posting Permissions

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