AroundTheFur
03-03-2004, 01:26 AM
So on my webpage right now (http://stevegh.com) I have it setup so when you click say on the motion section, and click on a movie link or whatever the content gets loaded into the right frame, and a little close button pops up. I'm doing this using a simple javascript onClick for the the links that load content into the right side. But if there is content in the right side and someone refreshes the page, the close button goes away. I tried to write a check onLoad and onUnload to see if that frame had the file "empty.html" or not and based on that show or hide the close button but there is something wrong with my != if statement in the second function here, as normally i will say if(loc!="empty.html) just change the className to closeUp but it always does that no matter what.
Here are my functions:
//called by the close button itself and links that load content
function contentClose(openIt){
if(!openIt){
parent.frame2.location = "empty.html";
document.getElementById("close").className = 'closeDown';
} else if(openIt){
document.getElementById("close").className = 'closeUp';
}
}
and
//called by body onLoad where loc = parent.frame2.location
function checkClose(loc){
if(loc != "empty.html"){
contentClose(false);
} else if(loc == "empty.html"){
contentClose(true);
}
}
so whats wrong with my != conditional? thanks in advance
-steve
Here are my functions:
//called by the close button itself and links that load content
function contentClose(openIt){
if(!openIt){
parent.frame2.location = "empty.html";
document.getElementById("close").className = 'closeDown';
} else if(openIt){
document.getElementById("close").className = 'closeUp';
}
}
and
//called by body onLoad where loc = parent.frame2.location
function checkClose(loc){
if(loc != "empty.html"){
contentClose(false);
} else if(loc == "empty.html"){
contentClose(true);
}
}
so whats wrong with my != conditional? thanks in advance
-steve