3 Replies Latest reply on Feb 12, 2010 2:01 PM by Nancy OShea

    Firefox Pop Up Window Size too Small

    sneedbreedley Level 1

      I made a pop up window that works great in IE but in Firefox the window is too small for the content. I see online that this is a known issue with Firefox, but is there any code that will ensure my pop up window will open to the right size in Firefox?

        • 1. Re: Firefox Pop Up Window Size too Small
          Nancy OShea Adobe Community Professional & MVP

          This works for me in Firefox, etc...

           

          Here is the link code: (change '400','400' to resize your pop-up window. Make yours a tad bigger than the page inside it.)

           

          <a href="LINK.html" onclick="NewWindow(this.href,'mywin','400','400','yes','center');return false" onfocus="this.blur()">LINK</a>
          

          In DW, hit File > New > JavaScript.

          Copy and paste this code into your JavaScript page.

          Save it to your Scripts folder and name it mywin.js

           

          // mywin JavaScript Document
          <!--
          /****************************************************
               Pop-Up window
          ****************************************************/
          var win=null;
          function NewWindow(mypage,myname,w,h,scroll,pos){
          if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
          if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
          else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
          settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
          win=window.open(mypage,myname,settings);}
          // -->
          
          

           

          Insert script into your HTML document between the <head> and </head> tags:

           

          <script type="text/javascript" src="Scripts/mywin.js"></script>
          
          

           

           

           

          Nancy O.
          Alt-Web Design & Publishing
          Web | Graphics | Print | Media  Specialists
          www.alt-web.com/
          www.twitter.com/altweb
          www.alt-web.blogspot.com

          • 2. Re: Firefox Pop Up Window Size too Small
            sneedbreedley Level 1

            Which page does this code get embedded in?

            The page with the button that makes the window pop up or the page that is the pop up window?

            I'm also not sure what parts I replace with my page name, i.e. my pop up window is called addtocart.html.

            Do I replace the words NewWindow with that?

            • 3. Re: Firefox Pop Up Window Size too Small
              Nancy OShea Adobe Community Professional & MVP

              Which page does this code get embedded in?

               

              Just paste the link code I gave you along with the link to your Scripts/mywin.js into the parent page.  The child page will open inside a pop-up window.

               

              I'm also not sure what parts I replace with my page name, i.e. my pop up window is called addtocart.html.

               

              Just like any other HTML link code...

              <a href="addtocart.html"....


              HTML & CSS Tutorials - http://w3schools.com/

               

               

              Nancy O.
              Alt-Web Design & Publishing
              Web | Graphics | Print | Media  Specialists
              www.alt-web.com/
              www.twitter.com/altweb
              www.alt-web.blogspot.com