第一個函數(可在http://nadiana.com/jquery-confirm-plugin找到):如何結合兩個jQuery函數?
$('#confirm').confirm(
{
msg: 'You are about to delete gallery and all images related to that gallery. Are you sure?<br>',
buttons: {
separator: ' - '
}
}
);
基本上沒有是/否的問題,如果你回答是,它進一步進行。
二級功能:
$(document).ready(function() {
$('#load').hide();
});
$(function() {
$(".delete").click(function() {
$('#load').fadeIn();
var commentContainer = $(this).parent();
var id = $(this).attr("id");
var string = 'id='+ id ;
$.ajax({
url: "<?php echo site_url('gallery/delete_image') ?>",
type: "POST",
data: string,
cache: false,
success: function(){
commentContainer.slideUp('slow', function() {$(this).remove();});
$('#load').fadeOut();
}
});
return false;
});
});
此功能用於刪除圖像。 我如何結合這兩個功能?首先,我想問問題,如果單擊是繼續刪除。
當有人說我愛「舒爾」:d – genesis
'$(文件)。就緒(函數(){'和'$(函數(){'實際上是一回事 – Blazemonger
@genesis:!我愛fainthful Linux的傢伙')' –