12 Replies Latest reply on Jun 18, 2013 4:26 PM by elainecc

    Center a pop up window (Was: How would I get this to work?)

    One Horse Level 1

      I want to open a popup window that is centered. Here is the code I am trying to use as a click from a button:

       


      centerPopUp('http://www.adobe.com', title, 500, 400) {

          var left = (window.screen.width / 2) - (width / 2);

          var top = (window.screen.height / 2) - (height / 2);

          var targetWin = window.open(

          pageURL,

          title,

              'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=1, resizable=1, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);

          targetWin.focus();

      }

       

      Seem to be missing something as it doesn't want to work from Animate. As usual, any and all help would be appreciated.

       

      Greg.....