Results 1 to 2 of 2

Thread: Pop-up Windows

  1. #1
    Join Date
    Nov 2005
    Posts
    40
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Pop-up Windows

    Ok, I have this javascript code but IE is having problems using it. I like the code because if the user does not or can not use javascript, they can still access the page.

    Header Code
    Code:
    <script language="javascript" type="text/javascript">
    <!--
    var win=null;
    function NewWindow(mypage,myname,w,h,scroll,pos){
    if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
    if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
    else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
    settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
    win=window.open(mypage,myname,settings);}
    // -->
    </script>
    Link Code
    Code:
    <a href="pop-up/standbyDetails.htm" onClick="NewWindow(this.href,'Typical Case Study','300','305','yes','center');return false">Major Components</a>

  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

    That looks like a gutted version of the output from this script wizard:

    http://www.dynamicdrive.com/dynamicindex8/popwin.htm

    If you use that link, set the specifications you desire and use the code that it generates, there should be no problems in IE.
    - 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
  •