Results 1 to 5 of 5

Thread: Open Window in Full Mode

  1. #1
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Arrow Open Window in Full Mode

    Hi Everybody.

    I want that if I open a link from inside an SWF file created with Swishmak that this page changes to another URL.
    But I want that when the page changes to the other URL that it resizes to full window mode.
    Can I use this code here below placed in the HTML file that I want to open?
    If not could someone please send me the right code for that.

    Thanks in advance.
    Cheng

    <script language="JavaScript1.2">
    <!--

    /***********************************************
    * Auto Maximize Window Script- © Dynamic Drive (www.dynamicdrive.com)
    * This notice must stay intact for use
    * Visit http://www.dynamicdrive.com/ for this script and 100's more.
    ***********************************************/

    top.window.moveTo(0,0);
    if (document.all) {
    top.window.resizeTo(screen.availWidth,screen.availHeight);
    }
    else if (document.layers||document.getElementById) {
    if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
    top.window.outerHeight = screen.availHeight;
    top.window.outerWidth = screen.availWidth;
    }
    }
    //-->
    </script>

  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

    You can use that but, many browsers will not allow it, depending upon their settings. Most however will. The only way to get a higher degree of compliance among browsers is to also use the window.open() method from your flash file if that is allowed:

    Code:
    window.open('thepage.html','','top=0, left=0, width='+screen.availWidth+', height='+screen.availHeight)
    - John
    ________________________

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

  3. #3
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Hi John.

    Thanks for your reply.
    I entered this script only in Swishmax and it worked, but it opened a new window.
    What I wanted was that the window that is already open changes to the new URL and then expands full window mode.
    Is this possible as well?
    Or maybe that when the new window opens, the one with the link to it closes automaticly would be ok, too.

    Thanks again.

    I appreciated.
    Cheng

  4. #4
    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

    Sorry, you can name the window with the flash on it and use that name with the window.open() method. That will launch the new page in the same window but window position and size can no longer be set by the window.open() method in that situation. What happens is that the existing window's size and position are inherited.

    On the other hand, you could close the existing window but, only if it had itself been opened using window.open(). This didn't use to be the case but, with phishing and other abuses of that nature, browsers will no longer allow a situation where the original window is closed via javascript. There must always be a window open that was arrived at via an ordinary link so that the user cannot be trapped in a pseudo site. You could always ask the user to close the first window him or herself.

    Alternatively, you could simply rely upon the original script you mentioned at the beginning of this thread. It will work in IE6, the most widely used browser. For those browsers that may not allow it (only some and then only if so configured), you could display instructions to maximise the window, like "best viewed full screen":

    Code:
    <script type="text/javascript">
    if ((top.window.outerWidth&&top.window.outerWidth<screen.availWidth)||(top.window.outerHeight&&top.window.outerHeight<screen.availHeight))
    document.write('Best viewed full screen')
    </script>
    The above could go in the body of the new page with the original script you have being in the head. If the script in the head fails and the user doesn't happen to be surfing fullscreen, then and only then will they see the message.
    - John
    ________________________

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

  5. #5
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Hi John.

    Thanks a lot.
    I'll give it a try and let you know the outcome.

    Thanks again.
    Cheng

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
  •