1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

Opening a Javascript Popup Window to fit the text inside

Discussion in 'General Internet' started by CUISTech, 2009/08/25.

  1. 2009/08/25
    CUISTech

    CUISTech Inactive Thread Starter

    Joined:
    2008/10/28
    Messages:
    419
    Likes Received:
    1
    Code:
    How does a <a href='http://intranet/FAQS/[FAQ item].htm' onclick= "return new_window('http://intranet/FAQS/[FAQ item].htm');" target= "test ">[FAQ Item]</a> work?
    I copied and pasted, then used the new link. I don't know how to Javascript. I'd like this window to fit all the text inside. (The original did. But it was also a much shorter block of text.) What variables do I need to put in there to do this?
     
  2. 2009/08/25
    TonyT

    TonyT SuperGeek Staff

    Joined:
    2002/01/18
    Messages:
    9,072
    Likes Received:
    400
    It depends on what the text is inside of.
    For example, if use a paragrapg for text and set the width of the paragraph to 500 px, then the new window must be at least 510 pixels to accomodate the text as well as window borders, wider if need to use a scrollbar.

    If the text container has no witdh set then the text will scale and wrap to fit the window.

    This javascriipt will open a window to the set dimensions:

    Code:
    <a href= "#" target= "_blank" onclick= "javascript:window.open('name-of-page.html','location=0,status=0,scrollbars=0,width=510,height=350'); ">CLICK HERE</a>
     

  3. to hide this advert.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.