If I understand this - you are trying add the class 'grid-loading'
when the button is clicked and remove it when the query completes.
If so, then the removeClass command needs to be in the callback
function of the .load command.

Paul

On Sep 29, 4:11 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> I'm trying to make a div give me a nice loading graphic on top of my
> data so the user knows the page is working on their request.
>
> I have the following code, however it seems it either happens to
> quickly or the event isn't working as expected.
>
>         \$("#query_button").click(function(){
>                 \$('#query').addClass('grid-loading');
>                 var store = \$("select#store").val();
>                 var dept = \$("select#dept").val();
>                 \$("#query").load('content.cgi', {storeselect: store, 
> deptselect:
> dept});
>                 \$('#query').removeClass('grid-loading');
>
>         });
>
> Anyone see what I'm doing wrong here?

Reply via email to