I have this following code copied from AndyMathews
http://andymatthews.net/read/2011/02/23/Add-a-Twitter-for-iPhone-Style-Swipe-Menu-to-jQuery-Mobile $('ul li').swiperight(function(event){
var $li = $(this);
// remove all buttons first
$('.aDeleteBtn').remove();
// create buttons and div container
var $deleteBtn = $('<a>Delete</a>').attr({
'class': 'aDeleteBtn ui-btn-up-r',
'href': 'some/link/page.html?nID=' + $li.data('nid')
});
$li.prepend($deleteBtn);
$('body').bind('tap', function(event){
// if the triggering object is a button, fire it's tap event
if (event.target.className.indexOf('aDeleteBtn') >= 0) $(e.target).trigger('click');
// remove any existing cancel buttons
$('.aDeleteBtn').remove();
$('body').unbind('tap');
});
});
Now what happens is when for the first time I swipe right on li then it shows a delete button and when tap anywhere it removes it.
But second time when i swiperight then it shows delete button but also execute the tap event which removes the button.
Can anyone help me as to why Tap event is firing after swiperight second time?