1 Reply Latest reply on Jul 26, 2006 8:05 AM by Newsgroup_User

    Centering Browser window

    Westside London
      Hi i want the web browser holding my flash site to always open central and at a specific size 800x600 when in the users screen when opened. (its not the publish settings, i can get my site to be central in the browser fine, i just want the browser to open at a sepcific size and central within the users screen) I think its some scripting I have to paste in the HTML head tag but im unsure of what the java scripting is?

      Can anyone help Me??

      Thanks
        • 1. Re: Centering Browser window
          Level 7

          "Adam Deeley" <webforumsuser@macromedia.com> wrote in message
          news:ea7v9q$hki$1@forums.macromedia.com...
          > Hi i want the web browser holding my flash site to always open central and
          > at a
          > specific size 800x600 when in the users screen when opened. (its not the
          > publish settings, i can get my site to be central in the browser fine, i
          > just
          > want the browser to open at a sepcific size and central within the users
          > screen) I think its some scripting I have to paste in the HTML head tag
          > but im
          > unsure of what the java scripting is?
          >

          This is defiantly a JavaScript question... but I will post the answer
          anyway.

          STICK THIS IN THE HEAD OF THE PAGE YOU ARE OPENING
          <script type="text/javascript">
          var myx = (screen.availWidth - window.innerWidth)/2;
          var myy = (screen.availHeight - window.innerHeight)/2;
          window.focus();
          window.moveTo(myx,myy);
          </script>

          STICK THIS ON THE PAGE YOU ARE OPENING THE POPUP FROM
          <a href="WINDOW-TO-OPEN" onclick="window.open(this.href, 'child',
          'width=800,height=600');return false;">Click</a>
          REPLACING WINDOW-TO-OPEN with the name of the page you are opening.