Results 1 to 5 of 5

Thread: New window in the foreground

  1. #1
    Join Date
    Nov 2008
    Posts
    1,259

    New window in the foreground

    I have an HTML link on my main page that opens a new window. The new window is displayed well in the foreground.

    Now I reclick another link on my main page, the result is displayed in the window above. So far so good.

    My only worry is that the window does not appear in the foreground.

  2. #2
    Join Date
    May 2008
    Posts
    271

    Re: New window in the foreground

    You have the focus method in JavaScript. If its page is called by this link, you can do like this

    <script type="text/javascript" src="focuswindow.js"> </ script>
    and you create a file focuswindow.js places where you just
    window.onload = function () {window.focus(this);}

  3. #3
    Join Date
    May 2008
    Posts
    2,389

    Re: New window in the foreground

    You can try this:

    Code:
    window. onload = function ( e ) { var w = ( ( e && e. currentTarget ) || this ) ; w. focus ( ) } ;
    It should work as standard (Firefox) or move (IE)

  4. #4
    Join Date
    Nov 2008
    Posts
    1,259

    Re: New window in the foreground

    The trouble, once I open my new window, it starts in the foreground (the focus is on the new window). I reduced the new window (without closing it), to return to the original page. I click on another link

    IE:
    The page reloads well in the open window above, and the latter appears in the foreground.

    In Firefox:
    The page reloads well in the open window above, but the focus remains on the original page.

    Here is the code for my link:
    Code:
    <a onclick="window.open('test.html','test','toolbar=0, location=0, directories=0, status=0, scrollbars=yes, resizable=0, copyhistory=0, menuBar=0, width=740, height=480')" style="cursor: pointer;">test</a>

  5. #5
    Join Date
    May 2008
    Posts
    2,389

    Re: New window in the foreground

    I know where the trouble: in Firefox, you go into Tools> Options> Content, and you click the button next to Enable JavaScript, you will find an option on whether to permit the fact of putting forward windows.

Similar Threads

  1. Replies: 2
    Last Post: 20-02-2011, 07:35 AM
  2. Replies: 4
    Last Post: 24-01-2011, 11:05 AM
  3. Replies: 3
    Last Post: 23-01-2011, 02:00 PM
  4. Replies: 4
    Last Post: 07-12-2009, 01:24 PM
  5. Replies: 8
    Last Post: 01-01-2007, 11:49 PM

Tags for this Thread

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
  •  
Page generated in 1,713,301,966.90567 seconds with 16 queries