Page 32 - LoudOffice_Guide-to-HTML_Part-II_Advanced.PDF
P. 32

Ø URL: This is the URL that you wish the popup window to open.
                   Ø Name: This is the name you assign to the window.
                   Ø Features: Controls if and how common browser features are displayed.
                              status  –  This controls the line at the bottom of the browser that displays
                          o
                              information, if you wish for it not to be included set status=no.
                              location – Shows the URL location bar for the page you are looking at.  To
                          o
                              turn this off, set location=no.
                              toolbar – this controls whether the button bar of your browser is displayed.
                          o
                              To turn this off, set toolbar=no.
                              menubar – this is the bar at the top of your browser window that shows the
                          o
                              drop down menus (File, Edit, etc.).  To turn this off set menubar=no.
                              scrollbars – these are the slides on the left and bottom of a window that let
                          o
                              you move up/down or left/right.  To turn these off, set scrollbars=no.
                              left / screenX –   controls the position of the window from the left of your
                          o
                              screen.  Measured in pixels.  Left is used by IE, screenX by Netscape.
                              top / screenY    –  controls the position of the window from the top of your
                          o
                              screen.  Measured in pixels.  Top is used by IE, screenY by Netscape.
                              height / width – controls the height and width of the window you wish to
                          o
                              create.
                              resizeable – controls whether the window size you assigned can be changed
                          o
                              by the user.
                       Note that when you use these features, they are contained within a set of quotation
                       marks, separated by commas and cannot contain spaces.

               The easiest way to declare a popup window is to call it as a variable:

                                                       v a r  m y W i n  =
                w i n d o w . o p e n ( “ h t t p : / / w w w . y a h o o . c o m ” , ” p o p u p ” , ” h e i g h t = 5 0 0 , w i d t h = 5 0 0 ” )
               The example below shows how a popup window like this may be used in an HTML
               document.



                    < h t m l >
                    < h e a d >
                    < t i t l e > J a v a S c r i p t  P o p u p  W i n d o w < / t i t l e >
                    < s c r i p t  l a n g u a g e = " J A V A S C R I P T " >
                    < ! - -  / /  H i d e
                    f u n c t i o n  p o p u p w i n ( )  {
                      w i n p o p u p  =
                    w i n d o w . o p e n ( ' h t t p : / / w w w . y a h o o . c o m ' , ' p o p u p ' , ' h e i g h t = 5 0 0 ,
                    w i d t h = 6 0 0 , m e n u b a r = n o , s c r o l l b a r s = y e s , s t a t u s = n o , t o o l b a r = n o ,
                    s c r e e n X = 1 0 0 , s c r e e n Y = 0 , l e f t = 1 0 0 , t o p = 0 , r e s i z a b l e = y e s ' ) ;
                    }
                    / / U n h i d e  - - >
                    < / s c r i p t >
                    < / h e a d >
                    < b o d y >
                    < f o r m  n a m e = " f o r m 1 " >
                    < i n p u t  t y p e = " b u t t o n "  v a l u e = " G o t o  Y a h o o . c o m "
                    o n c l i c k = " p o p u p w i n ( ) ; " >
                    < / f o r m >

                    < / b o d y >


               LoudOffice.com Guide to HTML – Part II                                               Page 32
   27   28   29   30   31   32   33   34   35   36   37