views:

82

answers:

3

This .aspx page has a very nice set of collapsible sections with little "+ -" controls.

http://www.microsoft.com/sqlserver/2008/en/us/editions-compare.aspx

Can anyone tell me how this might be done in Visual Studio?

I have tried using firebug to deconstruct the page but can't find the script that is doing the showCollapsibleItem() call.

Thank you!

+1  A: 

Try the AJAX Control Toolkit's CollapsiblePanel.

You can also do this trivially with jQuery:

$('a.toggler').click(function() { $(this.rel).toggle(); return false; });

<a href="#" rel="#section1">Section 1</a> 
<p id="section1">Lorem ipsum dolor sit amet, consectetur adipisicing elit, 
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad 
minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea 
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit 
esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat 
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
SLaks
Thank you for the answer.
CSharp Noob
+1  A: 

A cheap way would be to use jquery's .hide() and .show() events. Here is a tutorial called Simple Jquery Show/Hide Div that shows how to accomplish this. Here is a demostration of what the tutorial will do.

Hope this helps some.

Chris
A: 

If you didn't want to use jQuery, you could use the showCollapsibleItem function in the example page you have

function showCollapsibleItem(id) {if(document.getElementById(id+"ExpandIcon").className=='cueCollapsibleContentExpandIcon') {document.getElementById(id).style.display='block';document.getElementById(id+"ExpandIcon").className='cueCollapsibleContentCollapseIcon';} else {document.getElementById(id).style.display='none';document.getElementById(id+"ExpandIcon").className='cueCollapsibleContentExpandIcon';}}

http://www.microsoft.com/sqlserver/shared/core/2/js/js.ashx?pt=Column3Zone3&amp;c=cueCollapsibleContent

Andrew Martin