I see. Take a look at this ticket: http://dev.jqueryui.com/ticket/3613
It's not a generic solution, but works for the cookie-persistence-example:
$(...).accordion({
header: "h3",
event: "click hoverintent",
active: active,
change: function(event, ui) {
var index = $(this).find("h3").index ( ui.newHeader[0] );
$.cookie("accordion", index, {
path: "/"
});
},
autoHeight: false
});
Jörn
On Fri, Feb 20, 2009 at 8:02 PM, <[email protected]> wrote:
>
> Jorn ...
>
> Will do. I don't actually want to change these, all I'm trying to do
> is get the index of the active accordion element, but was trying
> various things in the process of figuring that out. If someone knows
> how to get the active element index, that's all I really wanted :)
>
> On Feb 20, 2:00 pm, Jörn Zaefferer <[email protected]>
> wrote:
>> Both options a currently only read when initializing the plugin. Could
>> you create a ticket for this and describe the usecase, that is, where
>> you'd need to change these options are init?http://dev.jqueryui.com/newticket
>>
>> Jörn
>>
>> On Fri, Feb 20, 2009 at 7:58 PM, <[email protected]> wrote:
>>
>> > Hi there ...
>>
>> > I posted a question yesterday on how to get the active element in an
>> > accordion, using .accordion('option', 'active') returns either the
>> > original value or one that had been previously set using .accordion
>> > ('option', 'active', X). The problem is that setting that option
>> > never seems to do anything, except cause the getter to return
>> > something different.
>>
>> > In playing around w/ this today, I noticed something similar w/ other
>> > options. For instance, if I change the 'event' option to 'mouseover',
>> > getting the event option will say mouseover, but it won't actually
>> > change the event on the widget. What might I be doing wrong? This is
>> > with 1.6rc6 & jquery 1.3.1.
>>
>> > Some quickie code just to show what I'm trying to do:
>>
>> > javascript:
>> > $(function(){
>> > $("#testAcc").click(function() {
>> > $("#accordion").accordion('option',
>> > 'event','mouseover');
>> >
>> > alert($("#accordion").accordion('option', 'event'));
>> > return false;
>> > });
>>
>> > // Accordion
>> > $("#accordion").accordion({ header: "h3",
>> >
>> > alwaysOpen:false,
>> >
>> > collapsible:true,
>> > active:false});
>>
>> > });
>>
>> > html:
>> > <h2 class="demoHeaders">Accordion</h2>
>> > <div id="accordion">
>> > <div>
>> > <h3><a href="#">First</a></h3>
>> > <div>Lorem ipsum dolor sit amet. Lorem
>> > ipsum dolor sit amet. Lorem
>> > ipsum dolor sit amet.</div>
>> > </div>
>> > <div>
>> > <h3><a href="#">Second</a></h3>
>> > <div>Phasellus mattis tincidunt nibh.</div>
>> > </div>
>> > <div>
>> > <h3><a href="#">Third</a></h3>
>> > <div>Nam dui erat, auctor a, dignissim
>> > quis.</div>
>> > </div>
>> > </div>
>>
>>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---