Tuesday, September 30, 2008

[jQuery] Re: Ajax Tabs and jqModal

on 9/30/08 8:17 AM, Klaus Hartl at klaus.hartl@googlemail.com wrote:

>
> http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_workin
> g_after_an_AJAX_request.3F
>
> If you choose to use rebinding, you would use the tabs load callback
> for that.
>
> $('#tabs > ul').tabs({
> fx: { height: 'toggle', opacity: 'toggle' },
> load: function(e, ui) {
> // rebind...
> $('a', ui.panel); // => all links inside loaded tab content
> }
> });
>
> --Klaus
>
>
> On 30 Sep., 16:20, "Steffan A. Cline" <stef...@hldns.com> wrote:
>> I have a scenario where I am using the jQuery UI tabs via ajax. The problem
>> I am running into is that with this code:
>> $().ready(function() {
>>      $('#tabs > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' } });
>>      $('#dialog').jqm({ajax: '@href', trigger: 'a.details'});
>>  });
>> I am binding the jqmodal action to the existing links with the "details"
>> class BUT problem is that items loaded via ajax do not subsequently get
>> bound. Is there a trick to make jqmodal attach the links after each ajax
>> call has been done?
>>
>> Thanks
>>
>> Steffan
>>

Klaus,

Thanks for the quick answer! I did realize that the issue was that the items
did not exist at the time of binding. I am new to jQuery and am trying to
understand all the nice amenities we have now in comparison to hand coding
all of this.

I tried to implement your example as a drop in and it seemed to make no
difference. Was there supposed to be more for me to add?


Thanks

Steffan

---------------------------------------------------------------
T E L 6 0 2 . 7 9 3 . 0 0 1 4 | F A X 6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline
Steffan@ExecuChoice.net Phoenix, Az
http://www.ExecuChoice.net USA
AIM : SteffanC ICQ : 57234309
YAHOO : Steffan_Cline MSN : steffan@hldns.com
GOOGLE: Steffan.Cline Lasso Partner Alliance Member
---------------------------------------------------------------

No comments: