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 10 of 10
  1. #1
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    making a popup "always" on top

    What parameter would I pass (for IE) to keep a pop-up
    always on top?

  • #2
    Regular Coder
    Join Date
    Jan 2004
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In the body line of the popup window add:
    Code:
    onBlur="self.focus();"

  • #3
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm. Didn't give an error, but didn't keep it on top either.

    <HEAD>
    <TITLE>Check Full Name</TITLE>
    </HEAD>
    <BODY onBlur='self.focus();'>

    is how the pop-up starts....

  • #4
    Regular Coder
    Join Date
    Jan 2004
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    try window.focus(); instead

  • #5
    Regular Coder
    Join Date
    Jul 2003
    Location
    NJ - #29 if you must know
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts
    no. still won't stay on top.

    Here's the problem

    The parent page spawns off a small pop-up,
    if someone accidentally clicks anywhere outside the popup
    window, the parent window becomes focused.

    and you have to click on the toolbar at the bottom to
    refocus the pop-up window.

    I thought there was a parameter you could pass when you
    open the window that would keep it on top...

    George

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,030
    Thanks
    0
    Thanked 247 Times in 244 Posts
    If your target browser is IE only, you can use Modal or Modeless dialog boxes.
    Mozilla also has modal window. - Modal dialogs with Mozilla-1.5
    In that link, there's a post that linked to a simulated modal windows that work cross-browser.

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    The Planet Earth Code Poet: True
    Posts
    282
    Thanks
    0
    Thanked 1 Time in 1 Post
    You could try continually setting focus:

    <body onload="setInterval(window.focus()',200)">

  • #8
    Regular Coder
    Join Date
    Jul 2003
    Location
    Massachusetts
    Posts
    472
    Thanks
    0
    Thanked 0 Times in 0 Posts
    John's solution should work fine (assuming you correct the slight syntax error) though there isn't really a need to continually request focus. Listening for an onblur event and then waiting a small amount of time before requesting focus should do the job. See: http://www.webdevfaqs.com/javascript.php#altpopupfocus.

  • #9
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,030
    Thanks
    0
    Thanked 247 Times in 244 Posts
    That would be annoying because you can't focus to other opened applications. You only bring the focus back to the popup if the focus is currently in the parent window not in other applications. I think that's what the author did in the link that I mentioned in my previous post.

  • #10
    Regular Coder
    Join Date
    Jul 2003
    Location
    Massachusetts
    Posts
    472
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Good point Glenn. The most practical solution would likely be to check if it's IE, if so, use showModalDialog; if Mozilla, use openDialog. Though, it would be nice if there was some kind of universal method or parameter that could be used&hellip;


  •  

    Posting Permissions

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