On Fri, Nov 14, 2008 at 3:31 PM, Hector Virgen <[EMAIL PROTECTED]> wrote:

> Thanks for your reply, Tristan. Unfortunately, that solution only works if
> the tabs are never changed. For example, if tomorrow my client asks me to
> switch tab 2 with tab 4, I will have to update my html *and* javascript. I
> would prefer to not have to update the javascript, which would be possible
> if the ui object could return the shown tab element directly.
> For example, something like this would be perfect:
>
> $('ul.tabs').tabs({
>    show: function(event, ui) {
>        var shownTab = ui.shownTab;
>        // disable form elements on the shown tab
>        shownTab.find('input', 'select').attr('disabled', 'disabled');
>    }
> });
>
> Is there anything like that available? Thanks!
>

>From http://docs.jquery.com/UI/Tabs#Events

$('.ui-tabs-nav').bind('tabsselect', function(event, ui) {
    ui.options // options used to intialize this widget
    *ui.tab // anchor element of the selected (clicked) tab*
    ui.panel // element, that contains the contents of the selected
(clicked) tab
    ui.index // zero-based index of the selected (clicked) tab
});

- Richard

Reply via email to