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
Cyril Gupta
2009-12-05 02:27:10
+1, you can also use `Toggle()` (http://docs.jquery.com/Events/toggle) to avoid having to store any visibility state.
Jared
2009-12-05 02:34:32
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
2009-12-05 05:45:09