Hello.
I have a function to "create" a Accordion of jQuery UI in my div .
It turns out that inside this my div there are several controls that make post on the page. What I want is that by making a post on the page, my accordion holds the state, ie if it is open, I want it to remain open, if it is closed, I want it to remain closed.
The code that "creates" the Accordion
$(document).ready(function () {
accordion();
});
function accordion() {
$("#accordion").accordion({
heightStyle: "content",
collapsible: true,
active: false,
beforeActivate: function (event, ui) {
// faço algumas coisas aqui.
}
});
}
The problem of "creating" the accordion in $(document).ready
is that it will be re-created every post
Addendum : I'm also using the AjaxControlToolkit UpdatePanel to keep the states of my page controls.
How do I make my function accordion();
only be called once?