Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to create collasible area

Status
Not open for further replies.

Karl Blessing

Programmer
Feb 25, 2000
2,936
US
I have a big table, created via ASP , has a left side and right side, bunch of stuff in it, and everything is indented as if a tree (parent-child) I could write into the ASP where if a parent is clicked run this event (in javascript or something of course) my only problem is I need a small example that will make any section of an HTML ( say a list of <TR> and stuff inside) expand and collaspe
Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)

 
good luck with the NS4.X part :eek:)

IE and NS6 you can just hide/show everything in the elements children array, i think jared@aauser.com
 
actucally, you might have to use the childNodes collection for NS6/IE support jared@aauser.com
 
well this works for both IE/NS4/NS6

Code:
<Html>
<Head>

<style type=&quot;text/css&quot;> 
.moreMenu 
	{
	position: relative;
	visibility: hidden;
	height: auto;
	}
.itemAnchor 
	{
	font-family: Verdana; 
	font-size: 12px; 
	color: black; 
	text-decoration: none
	}
</style>

<script>
if (document.layers) 
	{
	visible = 'show';
	hidden = 'hide';
	} 
else if (document.all) 
	{
	visible = 'visible';
	hidden = 'hidden';
	}

function barTog(menu) 
	{
	if (document.layers) 
		{
		daMenu = document.layers[menu];
		}
	else if (document.all) 
		{
		daMenu = document.all(menu).style;
		}
	if (daMenu.visibility == visible) 
		{
		daMenu.visibility = hidden;
		}
	else
		{
		daMenu.visibility = visible;
		}
	lastMenu = daMenu;
	}

</script>
</Head>
<Body>

<!--<div id=&quot;menuBar&quot;> </div>-->
<Table border=1>
<TR>
	<TD>
	<a href=&quot;#&quot; class=&quot;itemAnchor&quot; onclick=&quot;javascript: barTog('MoreMenu1'); return false;&quot;>Menu One</a>
	</TD>
</TR>
<TR>
	<TD id=&quot;MoreMenu1&quot; class=&quot;moreMenu&quot;>
	Aaron<br>
	Captain Cursor<br>
	Cassandra<br>
	Chris<br>
	Courtney<br>
	Jeff<br>
	Joanne<br>
	Jean Pierre<br>
	Klug<br>
	Kristin<br>
	Nadav<br>
	Taylor<br>
	Thau<br>
	Tim<br>
	Wendy<br> 
	</TD>
</TR>
<TR>
	<TD>
	<a href=&quot;#&quot; class=&quot;itemAnchor&quot; onclick=&quot;javascript: barTog('MoreMenu2'); return false;&quot;>Menu Two</a>
	</TD>
</TR>
<TR>
	<TD id=&quot;MoreMenu2&quot; class=&quot;moreMenu&quot;>
	Aaron<br>
	Captain Cursor<br>
	Cassandra<br>
	Chris<br>
	Courtney<br>
	Jeff<br>
	Joanne<br>
	Jean Pierre<br>
	Klug<br>
	Kristin<br>
	Nadav<br>
	Taylor<br>
	Thau<br>
	Tim<br>
	Wendy<br> 
	</TD>
</TR>
</Table>
</Body>

The only problem is I still have this huge gapping space btween one TR and the next, so that the part that would be visible, is still taking up the same space even if you cant see it.
Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)

 
ahhhh... you know of the display:none; style right? think IE and NS6 will support that jared@aauser.com
 
the only problem with Display: none; is I cant figure out how to make it show up again. yet it does close the gap.
Karl
kb244@kb244.com
Experienced in : C++(both VC++ and Borland),VB1(dos) thru VB6, Delphi 3 pro, HTML, Visual InterDev 6(ASP(WebProgramming/Vbscript)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top