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 3 of 3
  1. #1
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    817
    Thanks
    43
    Thanked 6 Times in 5 Posts

    focus popup onload

    I want to load a popup - as chromeless as I can get it - centre screen.

    This will almost do it, but regardless of my attempt to force focus, it stays behind the loader.

    If I could get rid of the loader that would be nice, but I'm thinking that is impossible. Still, all I need for now is for the popup to come to the front.

    Code:
    <html>
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>loader</title>
    <script LANGUAGE="javascript">
    <!--
    function popUp(URL,popW,popH) {
    var topPos = (screen.availHeight-popH)/2, leftPos = (screen.availWidth-popW)/2;
    mywin=window.open(URL,'popup','resizable=no, toolbar=no, location=no, status=no, scrollbars=no, menubar=no, titlebar=no, width=' + popW + ',height=' + popH + ',left=' + leftPos + ',top=' + topPos + ',screenX=' + leftPos + ',screenY=' + topPos);''
    mywin.focus();
    }
    // -->
    </script>
    
    </head>
    
    <body onload="javascript:popUp('mypopup.html',700,450)">
    Any ideas as to what I'm doing incorrectly?
    The difference between genius and stupidity is that genius has its limits. (Albert Einstein)

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    it doesnt make sense to me that the pop up isn't in front. unless you have something in the loader window that is drawing focus back to it. when a popup is created, it has focus by default. it should always be on top unless explicitly told not to (i.e. drawing focus to main window or blur() on pop up. )


    do you have any added software/plugins that might push pop-ups to the back? because the code you provided pops the window up in front and it keeps focus for me.
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #3
    Regular Coder tpeck's Avatar
    Join Date
    Oct 2002
    Location
    Sydney, Australia
    Posts
    817
    Thanks
    43
    Thanked 6 Times in 5 Posts
    Thanks.

    Something is very strange. If I upload the pages to the web and load page1.html, it all works as expected.

    But if I do the same thing offline, page1.html still has focus.

    Maybe I should reinstall IE7.

    Weird
    The difference between genius and stupidity is that genius has its limits. (Albert Einstein)


  •  

    Posting Permissions

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