Possible Duplicate:
How to have Ajax spinner show on specific page?
I have this nav menu with 2 tabs:
<div id="user_menu">
<ul class="nav nav-tabs">
<li class="active"><%= link_to "Group1", group1_friends_path(@user), :remote => true %></li>
<li><%= link_to "Group2", group2_friends_path(@user), :remote => true %></li>
</ul>
</div>
I've managed to let Ajax render certain partials. Now, when I click on the tabs the partials loads in my target placeholder div.
tab.js: which I placed in assest/javascripts/
$(function() {
$('#user_menu a').click(function (e) {
$('ul.nav-tabs li.active').removeClass('active')
$(this).parent('li').addClass('active')
$("#friends-data").fadeOut(function(){
$("#loading-indicator").fadeIn();
});
});
});
I don't like to show all the content all the same time and let the user wait for all the http request to render. I would like to show a loading bar and when all the http request is finished, hide the loadingbar and show the content.
Right know is more theatrical then functional. Any help, example would be appreciated.