user225229
user225229

Reputation: 1

JQuery collapsable Panel

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

Upvotes: 0

Views: 538

Answers (2)

m3kh
m3kh

Reputation: 7941

Try this:

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

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

Upvotes: 0

Cyril Gupta
Cyril Gupta

Reputation: 13723

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

Upvotes: 1

Related Questions