Results 1 to 4 of 4

Thread: Detecting fullscreen

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Posts
    9

    Question

    I've opened a page like this:

    window.open("test.php","","fullscreen,scrollbars")

    Can I in any way tell the user if he's running fullscreen or normal window? Like detecting it with javascript or something like that?

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    I don't think there is an easy way of detecting weather a page is full screan or not but if I open a window full screen with this code in it:
    Code:
    <html>
    <head> 
    <script Language='JavaScript'> 
    
    
    if (window.screen) {
    	document.write("Screen width: " + window.screen.availWidth);
    	document.write("Screen height: " + window.screen.availHeight);
    	
    }
    if (document.layers) {
         width = window.innerWidth;
         height = window.innerHeight;
     }
     else if (document.all) {
         width = document.body.clientWidth;
         height = document.body.clientHeight;
     }
     
     document.write("Page width: " + width);
     document.write("Page height: " + height);
     
    
    </script>
    </head>
    <body>
    </body> 
    </html>
    the output is:
    Screen width: 1024
    Screen height: 740
    Page width: 1024
    Page height: 768

    so, what you could do is just do a comparision between screen size and page size and if screen size is a lot bigger than page size, then you know the page isn't being displyed fullscreen.

    I hope this has been of help to you.
    Mark
    -------------------

  3. #3
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    kpn

    DID MY LAST REPLY HELP?

    If you don't give me any feed-back I won't bother answering your questions in future!!
    Mark
    -------------------

  4. #4

    Thread Starter
    New Member
    Join Date
    Dec 2000
    Posts
    9
    I'm sorry. I hadn't had time until now testing it. It helped me. But I left that fullscreen thing. Thanks for the help.

Posting Permissions

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



Click Here to Expand Forum to Full Width