【发布时间】:2014-08-01 06:56:03
【问题描述】:
好的,我这里有一个 Ajax 删除记录。我尝试添加 jquery 对话框确认而不是使用 javascript 确认。删除功能有效,但问题是删除行的动画不起作用。
这就是我现在所拥有的。 http://jsfiddle.net/altaire/YJC44/
任何帮助将不胜感激。谢谢!
PHP
while($row = $result->fetch_assoc()){
echo'<tr class="records">';
echo'<td>'.$i++.'</td>
<td align="center"><a href="#" name="'.$row["counter"].','.$row["idas"].'" class="delbuttons"><img src="images/del.png" border="0" width="10" height="10" title="Delete"></a></td>
<tr>;
Jquery/Ajax
$(".delbuttons").click(function () {
//e.preventDefault();
var element = $(this);
var del_id = element.attr("name");
var info = 'prdelete=' + del_id;
$("#dialog").dialog({
buttons: {
"Confirm": function () {
$.ajax({
type: "GET",
url: "delete.php",
data: info,
success: function () {}
});
$(this).parents(".records").animate({
backgroundColor: "#fbc7c7"
}, "fast")
.animate({
opacity: "hide"
}, "slow", function () {
setTimeout(function () {
window.location.reload();
}, 1000);
});
$(this).dialog("close");
},
"Cancel": function () {
$(this).dialog("close");
}
}
});
$("#dialog").dialog("open");
});
【问题讨论】:
标签: javascript jquery ajax