Tuesday, September 30, 2008

[jQuery] Re: Ajax Tabs and jqModal

http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_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
>
> ---------------------------------------------------------------
> 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  
> Stef...@ExecuChoice.net                             Phoenix, Azhttp://www.ExecuChoice.net                                 USA
> AIM : SteffanC          ICQ : 57234309
> YAHOO : Steffan_Cline   MSN : stef...@hldns.com
> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
> ---------------------------------------------------------------

No comments: