View Single Post
07-15-2007, 05:46 PM
#1
Jeff Andersen is offline Jeff Andersen
Status: Superstar
Join date: Apr 2005
Location:
Expertise:
Software:
 
Posts: 4,449
iTrader: 10 / 100%
 

Jeff Andersen is on a distinguished road

  Old  Show/hide dilemma

I was just wondering anyone could assist me with a bit of javascript. I have a simple show/hide toggle script:

Code:
	<script language="javascript">
	<!--

	var state = 'none';

	function showhide(layer_ref) {

	if (state == 'block') {
	state = 'none';
	}
	else {
	state = 'block';
	}
	if (document.all) { 
	eval( "document.all." + layer_ref + ".style.display = state");
	}
	if (document.layers) { 
	document.layers[layer_ref].display = state;
	}
	if (document.getElementById &&!document.all) {
	hza = document.getElementById(layer_ref);
	hza.style.display = state;
	}
	}
	//-->
	</script>
Works awesome, however I want to modify it so that if "Div1" is shown, "Div2" cannot be expanded. Is there a way I can do this?

Thanks
Jeff