Search code examples
ajaxloadingjquery-ui-tabs

is there a better way to show loading message with jquery ui tabs?


using jquery ui tabs, when you load a tab in ajax, the tab changes message to say "Loading . ." i think this is a little subtle.

Is there anyway you can do something in this content area of the tab similar to what block ui does when you are loading a call in ajax.


Solution

  • You would display a loading message within the content area like so (untested):

    $('#selector').bind('tabsselect', function(event, ui) {
    
        // show default $.blockUI loading message
        $('ui.panel').blockUI();
    }).bind('tabsload', function(event, ui) {
    
        // remove loading message
        $('ui.panel').unblockUI();
    });