Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Trouble opening popup in IE on Windows XP

    I have a Flash Application which needs to be in a window that has a size of 1024 x 768, so I've included a javascript to set the popup's size to those dimensions. However, when I try to open the HTML page that has the javascript on a Windows XP computer, the popup window's dimensions aren't changing to those settings.
    I forgot to check to see what version of IE this computer has, but I think it is the default version that comes with XP. I used the following lines of code to open the window:

    windowW=1024;
    windowH=768;
    s = "width="+windowW+",height="+windowH;//+",scroll=0";
    var isIE = document.all?true:false
    if (isIE) {
    NW = window.open("","popFrameless",s)
    NW.blur();
    window.focus();
    NW.resizeTo(windowW,windowH)
    } else {
    NW = window.open("myFile.html", "popFrameless","scrollbars,"+s)
    NW.blur();
    NW.resizeTo(windowW, windowH)
    }

    Is there a different way to open a popup to a specific size in XP?

    Chris

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Your script seems a little complicated for what you want to do. How are you opening this window? With a link?
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <script type="text/javascript">
    <!--
    function openWin(url){
    	if(screen.width<=800){
    		sw="800";
    		sh="600";
    		sbar="1";
    	}
    	else {
    		sw="1024";
    		sh="768";
    		sbar="0";
    	}
    	newwin=window.open(url,'newwin','width='+sw+',height='+sh+',scrollbars='+sbar+',top=0,left=0,menubar=0,toolbars=0');
    }
    //-->
    </script>
    </head>
    
    <body>
    <a href="yourflashpage.html" onclick="openWin(this.href);return false">Link to Flash</a>
    </body>
    </html>
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Aug 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have my code running in the onLoad event of another html page.

  • #4
    Senior Coder nikkiH's Avatar
    Join Date
    Jun 2005
    Location
    Near Chicago, IL, USA
    Posts
    1,973
    Thanks
    1
    Thanked 32 Times in 31 Posts
    Do you realize this code will not reliably detect only MSIE and can mess up tabbed browsers such as Opera and Avant Browser?

    I don't know if this is for intranet or internet, but that might be an issue for you. Also, MSIE 7 will have tabs. Just FYI.

    If this post contains any code, I may or may not have tested it. It's probably just example code, so no getting knickers in a bunch over a typo, OK? If it doesn't have basic error checking in it, such as object detection or checking if objects are null before using them, put that in there. I'm giving examples, not typing up your whole app for you. You run code at your own risk.
    Bored? Visit
    http://www.kaelisspace.com/


  •  

    Posting Permissions

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