views:

392

answers:

5

Hi, I'm using JQTOUCH and in JQTOUCH several of the links are being loading via AJAX and then sliding in. The problem is that there is no loading indication provided to users.

I'd like a way to add a Loading class with an AJAX spinner, when ever the an ajax call is loading, and have the class removed when the loading is done, and the page is displayed.

Any ideas?

+1  A: 

This is the basic behavior if your links are li class="arrow" elements. how are you displaying your links and where do you want the loading-spinner to display?

Volmar
A: 
Darin Parker
A: 
A: 

You could add a custom event handler, and trigger the loading.gif everytime the click on the specific element was done.

vertic4l
A: 

the showPageByHref() answer is partially correct.

But, instead of

$('body').append('<div id="loadinginprogress">Loading...</div>');

You need

$('.current').append('<div id="loadinginprogress">Loading...</div>');

Body is too general for jqtouch, need to be specific to the currently displayed DIV-page