D
dwilson
Hi Folks,
I am having a strange Javascript issue. I have a div that I show and
hide by clicking on an image link, and all images within the div do not
show up in IE. FireFox does not give me this problem. Also, under IE,
when I expand the div and adjust the font size with <control + mouse
wheel> the images show up.
When I do not set the div's style.position at all in the javascript,
this problem does not occur. I am making a tree, however, so that is
not an option since the elements end up on top of each other.
The code...
<html>
<head>
<title>Expand Tree</title>
<script LANGUAGE="JavaScript">
function splodeDiv(divRef, imgRef){
var theDiv = document.getElementById(divRef);
var theImg = document.getElementById(imgRef);
var divState = theDiv.style.visibility == "hidden";
theDiv.style.visibility = divState ? "visible" : "hidden";
theDiv.style.position = divState ? "relative" : "absolute";
theImg.src = divState ? "minus.gif" : "plus.gif";
}
function load(){
var allImgs = document.getElementsByTagName('img');
for(var i = 0; i < allImgs.length; i++){
if(allImgs.id.search('expandRetract' != -1)){
allImgs.src = "minus.gif";
}
}
var allDivs = document.getElementsByTagName('div');
for(var i = 0; i < allDivs.length; i++){
if(allDivs.id.search('folderGroup' != -1)){
allDivs.style.visibility = "visible";
allDivs.style.position = "relative";
}
}
}
</script>
</head>
<body onload="javascript:load();">
<a href="javascript:splodeDiv('folder Group1', 'expandRetract1');"><img
id="expandRetract1" src="minus.gif" border="0"></a>
<div id="folder Group1">
Howdy!
<img src="minus.gif">
<img src="minus.gif">
<img src="minus.gif">
</div>
</body>
</html>
Any help on this would be a life saver. I am past a deadline for a
demo!
Dan Wilson
I am having a strange Javascript issue. I have a div that I show and
hide by clicking on an image link, and all images within the div do not
show up in IE. FireFox does not give me this problem. Also, under IE,
when I expand the div and adjust the font size with <control + mouse
wheel> the images show up.
When I do not set the div's style.position at all in the javascript,
this problem does not occur. I am making a tree, however, so that is
not an option since the elements end up on top of each other.
The code...
<html>
<head>
<title>Expand Tree</title>
<script LANGUAGE="JavaScript">
function splodeDiv(divRef, imgRef){
var theDiv = document.getElementById(divRef);
var theImg = document.getElementById(imgRef);
var divState = theDiv.style.visibility == "hidden";
theDiv.style.visibility = divState ? "visible" : "hidden";
theDiv.style.position = divState ? "relative" : "absolute";
theImg.src = divState ? "minus.gif" : "plus.gif";
}
function load(){
var allImgs = document.getElementsByTagName('img');
for(var i = 0; i < allImgs.length; i++){
if(allImgs.id.search('expandRetract' != -1)){
allImgs.src = "minus.gif";
}
}
var allDivs = document.getElementsByTagName('div');
for(var i = 0; i < allDivs.length; i++){
if(allDivs.id.search('folderGroup' != -1)){
allDivs.style.visibility = "visible";
allDivs.style.position = "relative";
}
}
}
</script>
</head>
<body onload="javascript:load();">
<a href="javascript:splodeDiv('folder Group1', 'expandRetract1');"><img
id="expandRetract1" src="minus.gif" border="0"></a>
<div id="folder Group1">
Howdy!
<img src="minus.gif">
<img src="minus.gif">
<img src="minus.gif">
</div>
</body>
</html>
Any help on this would be a life saver. I am past a deadline for a
demo!
Dan Wilson