Hold touch event events for ipod touch

I am using jQuery mobile beta and jquery 1.6. On ipod touch, the swipe event also triggers a switch event. This issue is not obsessed with Android devices. I am trying to find a Google solution, but it looks like there is not much with the same problem. Is there something very basic that I am missing?

$("div.totapandswipe").bind('tap',function(event, ui){
    alert('event');
});

$("div.totapandswipe").bind('swipe',function(event, ui){
            alert('event');
});

Thanks for the help!

+5
source share
2 answers

, ('click') bind (swipeleft swiperight). , 'click' . - -, , . .

$('#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 to flip the card.\n Tap for a new card.\nuse Options to turn Tips back 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 ');
    });
});
+1

:

$("selector").swiperight(function (e) {
  if (e.type === "swiperight") {
    myHandler(e);
  }
});

, . Jqm ?

+1

All Articles