Results 1 to 2 of 2

Thread: A newbie question

  1. #1
    Join Date
    Mar 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default A newbie question

    Hi guys/gals

    I have a quick question pertaining to web design, however using a particular java script to generate pop ups. Now my issue is as follows: I have created a website that resides in a big pop up but I need to open additional pop ups while in the "main popup".

    The problem is that when I try to do so it overrides the "main popup" when I want it to open in a seperate popup untop of that pop up. Any help would be appreciated.

    Javascript that goes in the head of the page:

    <script language="javascript">
    var win = null;
    function NewWindow(mypage,myname,w,h,scroll){
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings =
    'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
    win = window.open(mypage,myname,settings)
    }
    </script>

    Body of page:

    <a href="images/forsale/foxrun/bigpictures/picture2.html" onClick="NewWindow(this.href,'name','720','530','n');return false">
    <img border="0" src="images/forsale/foxrun/pic2.gif" width="120" height="120">

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    By naming a window, in this case you've given it the name of 'name', and then later opening into the same named window, you will overwrite the existing window of the same name:

    Code:
    <a href="images/forsale/foxrun/bigpictures/picture2.html" onClick="NewWindow(this.href,'name','720','530','n');return false">
    If however, you use a unique name for each additional window, it will create its own distinct window:

    Code:
    <a href="images/forsale/foxrun/bigpictures/picture2.html" onClick="NewWindow(this.href,'fred','720','530','n');return false">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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