Accordion - How to display a specific element ?

Accordion - How to display a specific element ?

pearly_030pearly_030 Posts: 42Questions: 0Answers: 0
edited December 2011 in General
Hello,

I have 2 elements in accordion.
The element number 1 displays a datatable.
When I click on a row i make some operations and then i want to hide the element 1 and to show the element 0.
I tested this code but it didn't work.

Can you help me ?
css
[code]
.accordion p {
display: none;
}
[/code]

Script
[code]
$(document).ready(function() {
......
$(function() {
$( "#accordion" ).accordion(
{autoHeight: true
});
});
// operations......
// ......
$('#accordion h3').eq(0).addClass("active");
$('#accordion p').eq(0).show();
.....
}
[/code]

Thanks

Replies

  • pearly_030pearly_030 Posts: 42Questions: 0Answers: 0
    OH! I'm stupid !!
    The solution is :
    [code]
    $('#accordion').accordion({ active: 0 });
    [/code]
This discussion has been closed.