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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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(el ementId);
ObjCount = 0;
for (i=0; i < showcaseSponsor.childNodes .length; i++){
if (showcaseSponsor.childNode s[i].hasCh ildNodes() && showcaseSponsor.childNodes [i].childN odes[0].no deName == "IMG" && showcaseSponsor.childNodes [i].childN odes[0].wi dth == 1){
showcaseSponsor.removeChil d(showcase Sponsor.ch ildNodes[i ]);
var skyScraperAd = document.getElementById("s kyScraperA d");
for (i=0; i < skyScraperAd.childNodes.le ngth; i++){
if (skyScraperAd.childNodes[i ].hasChild Nodes()){
skyScraperAd.removeChild(s kyScraperA d.childNod es[i]);
}
}
skyScraperAd.removeChild(s kyScraperA d.childNod es[0]);
ObjCount += 1;
}
}
//alert(ObjCount);
if(ObjCount == 2){
resizeTo('381','800');
}else{
document.getElementById("s kyScraperA d").style. display = "block";
document.getElementById("s howcaseSpo nsor").sty le.height = "150px";
document.getElementById("s howcaseSpo nsor").sty le.padding Bottom = "12px";
resizeTo('550','650');
//window.innerWidth = "550px";
//window.innerHeight = "650px";
//window.moveTo(0,0);
var showcaseExclusiveSponsor = document.getElementById("s howcaseExc lusiveSpon sor");
for (i=0; i < showcaseExclusiveSponsor.c hildNodes. length; i++){
if ((showcaseExclusiveSponsor .childNode s[i].hasCh ildNodes() && showcaseExclusiveSponsor.c hildNodes[ i].childNo des[0].nod eName == "IMG")||(showcaseExclusive Sponsor.ch ildNodes[i ].nodeName == "OBJECT")){
showcaseExclusiveSponsor.r emoveChild (showcaseE xclusiveSp onsor.chil dNodes[i]) ;
}
}
}
}
function changePopUpSize(elementId)
var showcaseSponsor = document.getElementById(el
ObjCount = 0;
for (i=0; i < showcaseSponsor.childNodes
if (showcaseSponsor.childNode
showcaseSponsor.removeChil
var skyScraperAd = document.getElementById("s
for (i=0; i < skyScraperAd.childNodes.le
if (skyScraperAd.childNodes[i
skyScraperAd.removeChild(s
}
}
skyScraperAd.removeChild(s
ObjCount += 1;
}
}
//alert(ObjCount);
if(ObjCount == 2){
resizeTo('381','800');
}else{
document.getElementById("s
document.getElementById("s
document.getElementById("s
resizeTo('550','650');
//window.innerWidth = "550px";
//window.innerHeight = "650px";
//window.moveTo(0,0);
var showcaseExclusiveSponsor = document.getElementById("s
for (i=0; i < showcaseExclusiveSponsor.c
if ((showcaseExclusiveSponsor
showcaseExclusiveSponsor.r
}
}
}
}
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
Also in you your code resizeTo () method need to know about window object
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().