Opening New Windows that are a Specific Size

Discussion in 'JavaScript' started by travoholic, Mar 15, 2006.

  1. #1
    Hello,

    I want to have some photo thumbnails on a page and when they're clicked want to open a new window that is a specific size for an enlarged version of the photo without all the typical Explorer buttons at the top. I'm not sure if this is a programming or HTML question but could someone please point me in the right direction and tell me how this is done?

    Thanks!
    Kirsty
     
    travoholic, Mar 15, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this tool, its a good way to learn what popups can do.
     
    mad4, Mar 15, 2006 IP
  3. DuncanM

    DuncanM Well-Known Member

    Messages:
    136
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #3
    Here is one way to do it, with Javascript:

    function newWindow(p){// Function to open a new window
     var win = "width=600,height=300,menubar=yes,toolbar=yes,status=yes,scrollbars=yes,resizable=yes";
     window.open(p, "", win);
    } //End of function newWindow
    Code (markup):
    Then, in your HTML code, you'd have a statement similar to the following:

    please visit the <a href="javascript:newWindow('LstSqrBackSam.html')">Background and Worked Example page</a> (opens in a new window).
    Code (markup):
     
    DuncanM, Mar 15, 2006 IP
  4. fluid

    fluid Active Member

    Messages:
    679
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    70
    #4
    Just would like to make a small and trivial change to DuncanM function:

    ... menubar = no, toolbar = no ...

    so that you dont get the IE menus and buttons on your popup.

    For your reference to all the properties of the window.open function:
    javascript-coder.com/window-popup/javascript-window-open.phtml
     
    fluid, Mar 24, 2006 IP