jquery - Swipe event triggers tap event for ipod touch -
i using jquery mobile beta , jquery 1.6. on ipod touch, swipe event trigerring tap event. issue not hapenning on android devices. trying google out solution, looks there not many same problem. there basic missing??
$("div.totapandswipe").bind('tap',function(event, ui){ alert('event'); }); $("div.totapandswipe").bind('swipe',function(event, ui){ alert('event'); });
thank help!
i have found needed unbind('click') first option in bind('swipeleft swiperight') function. since swipe goes new page, page re-binds 'click' event page left. utility flashcard tap brings new card , swiping flips over. luck.
$('#flashverse').bind('swipeleft swiperight', function(event) { console.log(event.type); $('#flashverse').unbind('click'); if(event.type == 'swipeleft') { $.mobile.changepage('flashreference','flip'); } else { $.mobile.changepage('flashreference','flip',true,false); console.log('swiperight'); } }); $('#flashreference').live('pageshow',function(event,ui){ if((tipson() || ls.getitem('tipflash') == '1') && ui.prevpage.attr('id')!='flashverse') { ls.setitem('tipflash','0'); var msg = 'swipe flip card.\n tap new card.\nuse options turn tips on.'; if(phonegap) navigator.notification.alert(msg,dummy,'flash cards','ok'); else alert(msg); } $('#lnkflashverse').addclass('ui-btn-active').addclass('ui-state-persist'); $('#lnkflashreference').removeclass('ui-btn-active').removeclass('ui-state-persist'); $('#flashreference').bind('click', function(event) { console.log(event.type); newflashcard(); //$('#flashreference div[data-role="content"]').append('clicked '); }); });
Comments
Post a Comment