How Do You Define The Size of a New Targeted Window?

Discussion in 'HTML & Website Design' started by tvanslooten, Mar 9, 2007.

  1. #1
    I have some terms on my website that are hyperlinked and target a new window. The window has a brief definition of the term. Right now the targeted window is a full sized window, which looks stupid because the definition is only about 2-3 sentences long.

    What code do I use to specify the exact size of the window? In other words, I want the targeted window to be a small popup with the brief definition for these terms.

    Travis
     
    tvanslooten, Mar 9, 2007 IP
  2. Blame Me

    Blame Me Guest

    Messages:
    162
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If I remember correctly its something along the lines of:

    <a href="your-link" onClick="popup = window.open('your-link', 'PopupPage', 'height=500,width=500,scrollbars=yes,resizable=yes'); return false" title="Link">Link</a>

    With the bit in bold being the bit you need.

    Play around with the height/width to determine the size you require.
     
    Blame Me, Mar 9, 2007 IP
  3. tvanslooten

    tvanslooten Active Member

    Messages:
    133
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    68
    #3
    Perfect thanks! Just one more question...how do I add the "Close Window" link on the popup/targeted window so that they can just click on that to close the window?

    Travis
     
    tvanslooten, Mar 9, 2007 IP
  4. Blame Me

    Blame Me Guest

    Messages:
    162
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I used <a href="#" onClick="popup = window.close() ">Close Window</a> and it works in all browsers but IE. For that they can just hit the cross in the top right.

    I am sure their is a way to do this with javascript but I don't know that sorry.
     
    Blame Me, Mar 9, 2007 IP
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    That is javascript. The event handler's name is all lower case, "onclick".

    cheers,

    gary
     
    kk5st, Mar 9, 2007 IP