Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1618 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Show/hide dilemma

Thread title: Show/hide dilemma
     
    Thread tools Search this thread Display Modes  
Prev Previous Post   Next Post Next
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

     


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed