contextMenu
删除行时,我有该行的动画颜色的代码,但是当我向代码添加mouseout
和mouseover
部分时,已删除行的颜色不再改变:
$(function () {
$('.users').contextMenu({
selector: 'tr',
callback: function (key, options) {
if (key == 'delete') {
if (confirm(" Are you sure?")) {
$.post("../Actions/Delete.ashx", { type: "user", id: $(this).attr('id') });
$(this).animate({ backgroundColor: '#FF80FF' }, 1000);
}
}
},
items: {
"edit": { name: "edit" },
"delete": { name: "delete" }
}
});
//newly added part
$('tr').mouseover(function () {
$('td', this).animate
({ backgroundColor: "#80FF00" }, 300);
});
$('tr').mouseout(function () {
$('td', this).animate
({ backgroundColor: "white" }, 300);
});
//till here
});
删除确认后,我在控制台中看到此错误:
[13:08:10.282] 找不到元素@localhost:1299/Actions/Delete.ashx:1
我的错在哪里?