Jquery 移动 POP 向上捕捉点击
Jquery Mobile POP Up Capture Click
我有一个 Table 可以选择删除一行。
我的要求是,当单击删除 link 时,我需要显示 Jquery 移动弹出窗口,其中包含是或否选项,如果仅单击是
必须删除该行,否则什么都不做
你能告诉我怎么做吗??
这是我的代码
var original = $('table').html();
$('.delete').on('click', function() {
$("#itemdelpopup").popup("open");
$(this).closest('tr').children('td').addClass('deleteHighlight').animate({
padding: 0
}).wrapInner('<div />').children().slideUp(function() {
$(this).closest('tr').remove();
});
return false;
});
我已经用有效的解决方案更新了你的jsfiddle。
我刚刚将 ID 添加到弹出窗口中的按钮,以便能够以这种方式捕获点击事件:
var original = $('table').html();
var clickedTD;
$('.delete').on('click', function() {
$("#itemdelpopup").popup("open");
clickedTD=$(this).closest('tr').children('td');
});
$("#yes").click(function(event){
clickedTD.addClass('deleteHighlight').animate({
padding: 0
}).wrapInner('<div />').children().slideUp(function() {
$(this).closest('tr').remove();
});
$("#itemdelpopup").popup("close");
});
$("#no").click(function(event){
alert("the user clicked NO!");
$("#itemdelpopup").popup("close");
});
我有一个 Table 可以选择删除一行。
我的要求是,当单击删除 link 时,我需要显示 Jquery 移动弹出窗口,其中包含是或否选项,如果仅单击是 必须删除该行,否则什么都不做
你能告诉我怎么做吗??
这是我的代码
var original = $('table').html();
$('.delete').on('click', function() {
$("#itemdelpopup").popup("open");
$(this).closest('tr').children('td').addClass('deleteHighlight').animate({
padding: 0
}).wrapInner('<div />').children().slideUp(function() {
$(this).closest('tr').remove();
});
return false;
});
我已经用有效的解决方案更新了你的jsfiddle。
我刚刚将 ID 添加到弹出窗口中的按钮,以便能够以这种方式捕获点击事件:
var original = $('table').html();
var clickedTD;
$('.delete').on('click', function() {
$("#itemdelpopup").popup("open");
clickedTD=$(this).closest('tr').children('td');
});
$("#yes").click(function(event){
clickedTD.addClass('deleteHighlight').animate({
padding: 0
}).wrapInner('<div />').children().slideUp(function() {
$(this).closest('tr').remove();
});
$("#itemdelpopup").popup("close");
});
$("#no").click(function(event){
alert("the user clicked NO!");
$("#itemdelpopup").popup("close");
});