tags:

views:

60

answers:

3

How does the Jquery use to create similar to Ajax CollapsiblePanel?

+1  A: 

Manually: Have a div for the header (which will be clicked to expand and collapse), and another div for the content (which will have the matter to be displayed).

here's an example.

//To Show
$('#myheader1').click(function(){$('#mycontent1').Show())};

//To Show
$('#myheader1').click(function(){$('#mycontent1').Hide())};

You'll have to maintain the visibility status in a variable.

Ready control

http://plugins.jquery.com/project/accordion

Cyril Gupta
+1, you can also use `Toggle()` (http://docs.jquery.com/Events/toggle) to avoid having to store any visibility state.
Jared
A: 

Thanks for your reply. I want to use in Listview item template for each row item. Is there any example which will show it uses with ASP.NET data controls?

A: 

Try this:

<ItemTemplate>
    <span class="title">Show/Hide</span>
    <div>
       <!-- put some elements here... -->
    </div>
</ItemTemplate>


$(".title").click(function() { $(this).next("div").slideToggle("slow"); });
Mehdi Golchin