Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

  1.  permalink
    I need to have this window open as a pop-up - www.rathcairn.com/textservice.html. The link text from the main page is:

    <div align="right" class="style54"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="textservice.html" class="style55" onClick="popUp('textservice.html','textservice','scrollbars=yes,resizable=yes,width=400,height=450')">Click Here</a></font></div>
    </div>

    ....but it is still opening as a full window. What am I doing wrong?

    Thanks,
    wildsaffy
    •  
      CommentAuthorbenjitastic
    • CommentTimeNov 23rd 2007 edited
     permalink
    Here is one way to do it:

    Javascript code on page:

    <script language="javascript"><!--
    function reallyCenterWindow() {
    leftPos = 0
    topPos = 0
    if (screen) {
    leftPos = (screen.width / 2) - 350 //350 is half of width
    topPos = (screen.height / 2) - 250 //250 is half of height
    }
    ElementWindow = window.open('http://google.com','ElementWin',
    'width=700,height=500,left='+leftPos+',top='+topPos)
    }
    //--></script>


    HTML:

    <a href="javascript:reallyCenterWindow()">Link</a>
    • CommentAuthorsardwon
    • CommentTimeNov 24th 2007
     permalink
    It looks like you've combined your own function, 'popUp' with the window method, 'open()'.

    Try replacing 'popUp' with 'window.open' (without the quotation marks).
  2.  permalink
    I would reconsider the popup approach and do a modal window with thickbox (jquery.com) or lightbox or similar.
Add your comments
    Username Password
  • Format comments as (Help)