Link to home
Start Free TrialLog in
Avatar of luxurylink
luxurylink

asked on

window.resizeTo('550','650') does not work with firefox

Hi,
I'm trying to resize a pop-up window after with window.resize('550', '650')
IE works fine, but Firefox is not working.
any Ideas ?

I trimmed the code is it will be easier to spot the problem

function changePopUpSize(elementId){
    //Some code...  
    //alert(ObjCount);
    if(ObjCount == 2){
      resizeTo('381','800');
    }else{
      //Some code...  
      resizeTo('550','650');
                //Some code...  
   }
}

I already tried window.innerHeight / window.innerWidtht, no luck so far

Thank you in advance,
Jack
Avatar of 0h4crying0utloud
0h4crying0utloud



Your code is working fine for me in IE and FF.  can you post more code?  I've seen FF choke on some legacy code that get elements by names or IDs with out using document.getElementById().
ASKER CERTIFIED SOLUTION
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of luxurylink

ASKER

Ok, here is the entire function, there are some objects that I play around with, but what's not working for me is that the window is not resizing...

function changePopUpSize(elementId){
            var showcaseSponsor = document.getElementById(elementId);
            ObjCount = 0;
            for (i=0; i < showcaseSponsor.childNodes.length; i++){
                  if (showcaseSponsor.childNodes[i].hasChildNodes() && showcaseSponsor.childNodes[i].childNodes[0].nodeName == "IMG" && showcaseSponsor.childNodes[i].childNodes[0].width == 1){
                        showcaseSponsor.removeChild(showcaseSponsor.childNodes[i]);
                        
                        var skyScraperAd = document.getElementById("skyScraperAd");
                        for (i=0; i < skyScraperAd.childNodes.length; i++){
                              if (skyScraperAd.childNodes[i].hasChildNodes()){
                                    skyScraperAd.removeChild(skyScraperAd.childNodes[i]);
                              }
                        }
                        
                        skyScraperAd.removeChild(skyScraperAd.childNodes[0]);
                        ObjCount += 1;
                  }
            }
            //alert(ObjCount);
            if(ObjCount == 2){
                  resizeTo('381','800');
            }else{
                  document.getElementById("skyScraperAd").style.display = "block";
                  document.getElementById("showcaseSponsor").style.height = "150px";
                  document.getElementById("showcaseSponsor").style.paddingBottom = "12px";
                  resizeTo('550','650');
                  //window.innerWidth = "550px";
                  //window.innerHeight = "650px";
                  //window.moveTo(0,0);

                  var showcaseExclusiveSponsor = document.getElementById("showcaseExclusiveSponsor");
                  for (i=0; i < showcaseExclusiveSponsor.childNodes.length; i++){
                        if ((showcaseExclusiveSponsor.childNodes[i].hasChildNodes() && showcaseExclusiveSponsor.childNodes[i].childNodes[0].nodeName == "IMG")||(showcaseExclusiveSponsor.childNodes[i].nodeName == "OBJECT")){
                              showcaseExclusiveSponsor.removeChild(showcaseExclusiveSponsor.childNodes[i]);
                        }
                  }
            }
      }
Look at the my post, do not use ' (quote) for the parameter values,

Also in you your code resizeTo ()  method need to know about  window object