我有一個是通過「喀嗒」處理觸發jQuery函數:jQuery的點擊回調
$('#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);
}
});
我想有一個AJAX負載指示動畫,所以我需要它來顯示當點擊觸發,並隱藏在操作完成的時候,所以我的數字回調但它似乎並沒有工作,當我將它設置如下:
$('#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();
);
謝謝! ) –