Faceboxダイアログでキャンセルまたは削除ボタンが押されたかどうかを確認するjQuery関数を作成しようとしていますが、どうすればよいかわかりません。
今、私は持っています:
// Confirm and remove group members
$("[id^='removeGroupMember_']").click(function () {
confirmDialog('Removal', 'Are you sure you want to remove this person from the group?');
// I need to check the results of the confirm dialog prior
// to calling the code below to remove the actual rows
$(this).parent().slideUp("fast", function () {
$(this).remove();
updateGroupRows();
});
return false;
});
どこconfirmDialog
にある:
function confirmDialog(action, message) {
$.facebox('<h3 class="confirmHeader light tb">Confirm ' + action + '</h3><div class="confirmContent"><p>' + message + '</p><a href="#" id="dialogConfirmAction" class="ras small red button right">' + action + '</a><a href="#" id="dialogConfirmCancel" class="ras small gray button right">Cancel</a></div>');
};
現在、これらのボタンが押されたときの関数が 2 つありますが、関連する行を削除するかどうかを決定できるように、結果を確認してフィードバックする方法がわかりません。
$('#dialogConfirmAction').live('click', function() {
console.log('Yep... they dun clicked it.');
return true;
});
$('#dialogConfirmCancel').live('click', function() {
$.facebox.close();
return true;
});
あなたが提供できるガイダンスは大歓迎です!