Results 1 to 2 of 2

Thread: Eric King Center Popup IE7 problem

  1. #1
    Join Date
    Jun 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Eric King Center Popup IE7 problem

    1) Script Title: Auto center window script- Eric King

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...autocenter.htm

    3) Describe problem: Is opening two windows. One in the target self of windows and the other is the center popup. (Problem only in IE7).

    What can i do for only open the center popup window?

    PHP Code:
    var win null;
    function 
    NewWindow(mypage,myname,w,h,scroll){
    LeftPosition = (screen.width) ? (screen.width-w)/0;
    TopPosition = (screen.height) ? (screen.height-h)/0;
    settings =
    'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
    win window.open(mypage,myname,settings)

    PHP Code:
    onclick="NewWindow(this.href,'name','936','620','no');return false" 
    thanks for any suggestions!

    regards!

  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

    Nothing wrong with your code, works fine in IE 7 here:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/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>
    </head>
    <body>
    <a href="http://www.google.com/" onclick="NewWindow(this.href,'name','936','620','no');return false">test</a>
    </body>
    </html>
    Might be some setting(s) you have on your copy of IE 7. Under Vista, the default settings may be more restrictive. In other Windows OS's you can just reset to the defaults. This may also work in Vista.
    - 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
  •