Hi,
The following code works fine in FF but when I see it IE 6 and above the collapse/expand does not work correctly. But when I remove the <!DOCTYPE>;ie. the document type declaration, it works fine…
Here is the script:
<script language=”javascript”>
function showhide(layer_ref,img) {
if (document.all) { //IS IE 4 or 5 (or 6 beta)
state = eval( “document.all.” + layer_ref + “.style.display”);
if ((state == ‘block’) || (state == ”)) {
state = ‘none’;
document.images[layer_ref + “img”].src= “_un.gif”;
if (document.thisform) {
if (document.thisform.showhide) {
document.thisform.showhide.value = “U”;
}
}
} else {
document.images[layer_ref + “img”].src= “
state = ‘block’;
if (document.thisform) {
if (document.thisform.showhide) {
document.thisform.showhide.value = “H”;
}
}
}
eval( “document.all.” + layer_ref + “.style.display = state”);
}
if (document.layers) { //IS NETSCAPE 4 or below
state = document.layers[layer_ref].display;
if ((state == ‘block’) || (state == ”)) {
state = ‘none’;
document.images[layer_ref + “img”].src= “
if (document.thisform) {
if (document.thisform.showhide) {
document.thisform.showhide.value = “U”;
}
}
} else {
state = ‘block’;
document.images[layer_ref + “img”].src= “
if (document.thisform) {
if (document.thisform.showhide) {
document.thisform.showhide.value = “H”;
}
}
}
document.layers[layer_ref].display = state;
}
if (document.getElementById &&!document.all) {
hza = document.getElementById(layer_ref);
state = hza.style.display;
if ((state == ‘block’) || (state == ”)) {
state = ‘none’;
document.images[layer_ref + “img”].src= “
if (document.thisform) {
if (document.thisform.showhide) {
document.thisform.showhide.value = “U”;
}
}
} else {
state = ‘block’;
document.images[layer_ref + “img”].src= “
if (document.thisform) {
if (document.thisform.showhide) {
document.thisform.showhide.value = “H”;
}
}
}
hza.style.display = state;
}
}
</script>
Please correct it…..The complete html file is attached.. Please please correct it…
Regards,
Ayusman
[upl-file uuid=b2db94f3-a740-447c-831c-67372666901a size=8kB]Untitled-5.zip