Results 1 to 2 of 2

Thread: Popup Window Help Please

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2002
    Location
    Michigan
    Posts
    143

    Popup Window Help Please

    OK I have this code for a popup window that I found...

    <script language="JavaScript">
    <!--
    var w = 480, h = 340;

    if (document.all) {
    /* the following is only available after onLoad */
    w = document.body.clientWidth;
    h = document.body.clientHeight;
    }
    else if (document.layers) {
    w = window.innerWidth;
    h = window.innerHeight;
    }

    var popW = 300, popH = 200;

    var leftPos = (w-popW)/2, topPos = (h-popH)/2;

    window.open('tcw.htm','popup','width=' + popW + ',height='+popH+',top='+topPos+','left='+leftPos);
    //--></script>





    Now I put that in the head section I think right?

    My question is, how do I actually popup the window? IM confused on that part. Lets say I have a page called a.html with a link on it called "CLICK HERE" once you click that link, it will open up the popupwindow. Do I need more code in the body?

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    Wrap all that code in a function here it's called myFunction
    then
    Code:
    <a href="javascript:myFunction();">click me</a>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width