Web Analytics Made Easy -
StatCounter Detecting full-screen - CodingForum

Announcement

Collapse
No announcement yet.

Detecting full-screen

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Detecting full-screen

    I have two versions of my site - one runs full-screen, the other in a regular browser window. However, I'd like to offer certain features in one or the other 'modes' only - like a seperate 'Nav' section when running full-screen.

    So, how do I detect whether a window is fullscreen or not?

    Many thanks,

    peetm

  • #2
    I've never heard of document.offsetWidth etc - I'm guessing that, if these are zero, the the point 0, 0 of the client-area is at the screen co-ord 0, 0 too??

    Is that right as it sounds as though that might work for me.

    What I need is someway to do that - to test whether 0, 0 is at screen co-ord 0, 0 I guess.

    peetm

    Comment


    • #3
      <SCRIPT LANGUAGE="JavaScript">
      if (this.name!='fullscreen'){
      document.write('This is in Fullscreen!');
      }
      </SCRIPT>
      Quيet Storm Designs ~ Art is not what you see, but what you make others see.
      · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

      Comment


      • #4
        in my own personal experience, the window name hardly ever comes into use, except with popups and frames. i think i'd solve this issue, by setting the window's name when the decision for fullscreen or normal happens. then, you could check to see what the window's name is, and go on that.
        bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

        i am a loser geek, crazy with an evil streak,
        yes i do believe there is a violent thing inside of me.

        Comment


        • #5
          Value of &quot;fullscreen&quot;

          Is there a way to determine the value of "fullscreen" once a window has been opened to fullscreen?

          I want to be able to only enlarge the window to say:

          fullscreen / 2;


          Thanks!

          Comment


          • #6
            If you want a ½ fullscreen, that would be a "Chromeless"-type window. Visit http://www.microbians.com for more information.
            Quيet Storm Designs ~ Art is not what you see, but what you make others see.
            · the Storms· || ·Ultraviolent Winter· || ·Was Einstein Wrong?· || ·It´s About Time!·

            Comment


            • #7
              Fullscreen Value

              I really want to know what the end-user's resolution is so that I don't resize a window too large for the screen...

              BTW QuietStorm: I didn't see the example at the link that you posted...thanks anyway!

              Comment


              • #8
                Window Size

                What is the best way to determine the current size of the user's window?

                I want to grab the value to set it and then set it back to the original value......

                Thanks!

                Comment


                • #9
                  Using IE

                  Ok I have seen many ways to determine the max screen size but I have not found the way to retrieve the value of the current window size using Internet Explorer...

                  Any ideas?!?!

                  Comment


                  • #10
                    Here is a script I use for my site at http://www.qiksearch.com/premshree

                    Code:
                    ////////////////////////////////////////////////////
                    ///// Bust It! : Full-Screen Buster JavaScript /////
                    ////////////// Created on 24 May 2002 //////////////
                    // (c) 2002 Premshree Pillai. All rights reserved //
                    ///////////// [url]http://www.qiksearch.com[/url] /////////////
                    ////////////////////////////////////////////////////
                    
                    var ie4_t=document.all&&navigator.userAgent.indexOf("Opera")==-1;
                    var ns6_t=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1;
                    var ns4_t=document.layers;
                    
                    var x1_test=document.body.clientWidth==screen.width;
                    var x2_test=document.body.clientHeight==screen.height;
                    
                    function BustIt()
                    {
                     if(!ie4_t)
                     {
                      window.self.close();
                     }
                     if(ie4_t)
                     {
                      if(!(x1_test&&x2_test))
                      {
                       alert('This page is optimised for Full-Screen View.');
                       this.window.close();
                       window.open('home.htm','Welcome','fullscreen=yes, scrollbars=auto');
                      }
                     }
                    }
                    
                    window.onload=BustIt;
                    Make the modifications to your needs.

                    Scripting | JavaScripts | PerlScripts | Python Scripts | Articles | My Journal

                    Comment


                    • #11
                      Thanks premshree...

                      Do you know how to return the value of the current size of the client window?

                      Using IE
                      Let's say the window was opened at 400,400.

                      Can you confirm that the window size is 400,400?

                      Thanks!

                      Comment


                      • #12
                        Code:
                        <script language="JavaScript">
                        if((document.body.clientWidth==400) && (document.body.clientHeight==400))
                        {
                         //Do something
                        }
                        else
                        {
                         //Do something
                        }
                        </script>
                        Scripting | JavaScripts | PerlScripts | Python Scripts | Articles | My Journal

                        Comment


                        • #13
                          Thanks again premshree ...but...

                          I want to be able to set variables to the current size of the window in relation to the user's window height and the user's window width

                          var currHeight = Some_DOM_compatible_window_height_value;
                          var currWidth = Some_DOM_compatible_window_width_value

                          Then your suggestion would work!
                          if((document.body.clientWidth==currWidth) && (document.body.clientHeight==currHeight))
                          I am sure that there has to be a way to do this within IE...

                          Can someone please enlighten us all!

                          Thanks!

                          Comment

                          Working...
                          X