I have this code:
$("#add_city").click(function() {
**$("#gif_loader").addClass("overlay");**
var oTT = TableTools.fnGetInstance( 'tab_citta' );
var aSelectedTrs = oTT.fnGetSelected();
var totAdded = 0;
$.each(aSelectedTrs, function(i, item) {
totAdded = totAdded + $(this).children().eq(1).html() * 1;
addRowAddedCity($(this).children().eq(0).html(),
"<span class='val_or right' style='text-align:right;'>"+$(this).children().eq(1).html()+"</span>",
"<input type='text' class='new_val right' value='" + $(this).children().eq(1).html() + "' />");
var pos = oTableAddedCity.fnGetPosition($(this).get(0));
oTableCity.fnDeleteRow(pos);
});
oTT.fnSelectNone();
$('#tot_city_sel').html( $('#tot_city_sel').html() * 1 + totAdded );
**$("#gif_loader").removeClass("overlay");**
});
The code between add and remove class take 3 seconds but I don't see the new class change ... It seems like the add and remove class are both executed after the inside code.