Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: automatic follow through to Full Screen window

  1. #1
    Join Date
    Oct 2008
    Posts
    19
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default automatic follow through to Full Screen window

    I have a question... and maybe you can help:

    To go to a full screen I am using the following script

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Full Screen PopUp window</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="javascript" type="text/javascript">
    <!--
    
    winWidth = 1024; // sets a default width for browsers who do not understand screen.width below
    winheight = 768; // ditto for height
    
    if (screen){ // weeds out older browsers who do not understand screen.width/screen.height
    winWidth = screen.width;
    winHeight = screen.height;
    }
    
    // this function calls a popupWindow where
    // win is the page address i.e. '../page.htm'
    
    function popupWindow(win){
    
    newWindow = window.open(win,'newWin','fullscreen=yes,titlebar=no,toolbar=no,location=no,addressbar=no, statusbar= no, scrollbars=yes, resizable= no,width='+winWidth+',height='+winHeight+',left=0,top=0');
    newWindow.focus();
    }
    // -->
    
    </script>
    </head>
    
    <body>
    <a href="javascript:popupWindow('myUrl.html')">Click Here</a>
    </body>
    </html>
    My question is:

    is it possible to not need the viewer of the website to click on "Click Here", but to make the browser go through to the full screen display of myUrl.html automaticly?

    I thought of using
    Code:
    window.location.replace("myUrl.html)
    , but can't get it to work.


    Or even better....:

    is it not possible to have myUrl.html load itself at full screen? Not needing any other window. This would be much better still. If possible..., how?


    Eddy
    Last edited by Hilholland; 10-17-2008 at 07:12 PM.

  2. #2
    Join Date
    Feb 2008
    Posts
    42
    Thanks
    0
    Thanked 13 Times in 13 Posts

    Default

    Code:
    window.location.href=(urlVariable)
    or
    window.location.href=('http://myUrl.dom')
    automatically from the second they log on to the page? That would pretty much be a onLoad event in the body tag to call the window function

    Code:
    function openUrl(){
        window.location.href=('http://myUrl.dom')
        window.resizeTo(screen.availWidth,screen.availHeight);
        window.moveTo(0,0)
    }
    Last edited by zaphod42; 10-18-2008 at 01:35 AM.

  3. The Following User Says Thank You to zaphod42 For This Useful Post:

    Hilholland (10-18-2008)

  4. #3
    Join Date
    Oct 2008
    Posts
    19
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    zaphod42,

    thanks for your reply.
    I am having difficulty getting it to work. How do i place this code within my code?

  5. #4
    Join Date
    Feb 2008
    Posts
    42
    Thanks
    0
    Thanked 13 Times in 13 Posts

    Default

    replace that whole javascript in your script tag with the openUrl function, and replace the url currently in the function with the one you would like to open....in your body tag you can do a

    Code:
    <body onLoad="openUrl()">
    you could also send in an argument to the function that can act as the url:

    Code:
    function openUrl(url){
        window.location.href=(url)
        window.resizeTo(screen.availWidth,screen.availHeight);
        window.moveTo(0,0)
    }
    then your body tag would look like this:
    Code:
    <body onLoad="openUrl('http://whatever.url')">
    if you change the function call in your old code to reference this function it will still work:

    Code:
    <a href="javascript:popupWindow('myUrl.html')">Click Here</a>
    becomes
    Code:
    <a href="javascript:openUrl('myUrl.html')">Click Here</a>
    you could also send in a second argument to define if you want to open the new link in the current window or in a new one:

    Code:
    function openUrl(url,newWindow){
        if(!newWindow){
           window.location.href=(url)
           window.resizeTo(screen.availWidth,screen.availHeight);
           window.moveTo(0,0)
        }else{
           newWindow = window.open(win,'newWin','fullscreen=yes,titlebar=no,toolbar=no,location=no,addressbar=no, statusbar= no, scrollbars=yes, resizable= no,left=0,top=0');
           newWindow.focus();
        }
    }
    now when you call the function you can send in a second argument to tell it to open in a new window:

    Code:
    openUrl('http://myUrl.com',true)
    will now open your popup window

  6. The Following User Says Thank You to zaphod42 For This Useful Post:

    Hilholland (10-18-2008)

  7. #5
    Join Date
    Oct 2008
    Posts
    19
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    zaphod42,

    thanks so much for your help.
    the following code works like i want it to, opening the window in the same window:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Full Screen PopUp window</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="javascript" type="text/javascript">
    <!--
    function openUrl(url){
        window.location.href=(url)
        window.resizeTo(screen.availWidth,screen.availHeight);
        window.moveTo(0,0)
    }
    </script>
    </head>
    
    <body onLoad="openUrl('http:myUrl')">
    </body>
    </html>

    Only thing is that I would like to add this following code to it

    Code:
    'titlebar=no,toolbar=no,location=no,addressbar=no, statusbar= no, scrollbars=no, resizable= no
    Where and how? Still opening in the same window.

    Also, do you know a way to keep a window out of the browsers history list (last visited windows)? This so that a visiter can never bypass and go straight to "http:MyUrl". Like, what keeps the page (that where putting the above code into) out of the history list?
    Last edited by Hilholland; 10-19-2008 at 12:03 AM.

  8. #6
    Join Date
    Feb 2008
    Posts
    42
    Thanks
    0
    Thanked 13 Times in 13 Posts

    Default

    the history is controlled by a property called window.history I believe, I haven't played with it a whole lot, I'll look into it a bit, as for the scrollbars and such....I don't know that you can set those properties on a window that is already open, and you can't close and reopen the window, because you aren't allowed to close windows that aren't opened by the script....so to take away all the extras, you'll have to open a new window

  9. The Following User Says Thank You to zaphod42 For This Useful Post:

    Hilholland (10-19-2008)

  10. #7
    Join Date
    Oct 2008
    Posts
    19
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    I am using a window that goes before this window that has the script:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>VAN SCHAYK V.O.F.**|**Financieel Administratieve Dienstverlening</title>
    <script language="JavaScript1.2">
    <!--
    
    /*
    Screen Size Redirect script (By Robert @ http://members.tripod.com/technological_tinker/)
    Submitted to Dynamicdrive.com to feature script in archive
    For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
    */
    
    
    if (screen.width==800||screen.height==600) //if 800x600
    window.location.replace("http://myUrl1")
    
    else if (screen.width==1024||screen.height==768) //if 640x480
    window.location.replace("http://myUrl1")
    
    else //if all else
    window.location.replace("http://myUrl2") 
    
    //-->
    </script>
    </head>
    
    <body>
    </body>
    </html>
    So this doesn't give me a possibility to add
    Code:
    'titlebar=no,toolbar=no,location=no,addressbar=no, statusbar= no, scrollbars=no, resizable= no
    either? I geuss not, seeing that this also doesn't open a new window.

  11. #8
    Join Date
    Feb 2008
    Posts
    42
    Thanks
    0
    Thanked 13 Times in 13 Posts

    Default

    nope, in that instance you are just altering the current window also, so it wasn't opened by the script, and so some of the properties are not available to alter....again this is as far as I can tell....also, the history object seems to have limited functionality.....there are security measures that are in place, for good reason, to keep people from doing certain things

  12. The Following User Says Thank You to zaphod42 For This Useful Post:

    Hilholland (10-19-2008)

  13. #9
    Join Date
    Oct 2008
    Posts
    19
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    thank you for being so generous with your knowledge.
    Is it then possible if i open a new window to automaticly close the old window that is opening the new window?
    Last edited by Hilholland; 10-19-2008 at 09:42 AM.

  14. #10
    Join Date
    Oct 2008
    Posts
    19
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by zaphod42 View Post
    you could also send in a second argument to define if you want to open the new link in the current window or in a new one:

    Code:
    function openUrl(url,newWindow){
        if(!newWindow){
           window.location.href=(url)
           window.resizeTo(screen.availWidth,screen.availHeight);
           window.moveTo(0,0)
        }else{
           newWindow = window.open(win,'newWin','fullscreen=yes,titlebar=no,toolbar=no,location=no,addressbar=no, statusbar= no, scrollbars=yes, resizable= no,left=0,top=0');
           newWindow.focus();
        }
    }
    now when you call the function you can send in a second argument to tell it to open in a new window:

    Code:
    openUrl('http://myUrl.com',true)
    will now open your popup window

    I am trying to apply this, but it is not working because, without a doubt, I am not getting it.

    Could you help please? Don't want a choice between same or new window, just want the new window now, and hopefully close the old window at the same time.
    Sorry for being such a dummy.

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
  •