I have jquery function that is triggered by a 'click' handler:
$('#showDatesCheckbox').click(function(){
var table = $('#planningViewTable').find('tr');
if ($('#showDatesCheckbox').is(':checked')) {
table.find('.textDate').stop().animate({
"opacity": 1
}, 1000);
table.find('.inlineTextDate').stop().animate({
"opacity": 1
}, 1000);
}
else {
table.find('.textDate').stop().animate({
"opacity": 0
}, 1000);
table.find('.inlineTextDate').stop().animate({
"opacity": 0
}, 1000);
}
});
I wanted to have an ajax loading indicator animation, so I need it to show when the click is triggered, and hide when the operation is completed, so I figure callback but it doesn't seem to be working when I set it up as follows:
$('#showDatesCheckbox').click(function(){
$('#planningView').mask('Loading...');
var table = $('#planningViewTable').find('tr');
if ($('#showDatesCheckbox').is(':checked')) {
table.find('.textDate').stop().animate({
"opacity": 1
}, 1000);
table.find('.inlineTextDate').stop().animate({
"opacity": 1
}, 1000);
}
else {
table.find('.textDate').stop().animate({
"opacity": 0
}, 1000);
table.find('.inlineTextDate').stop().animate({
"opacity": 0
}, 1000);
}
},
$('#planningView').unmask();
);