Skip to content

Accommodating jQuery Mobile Taphold Event #5

@Developsaurus

Description

@Developsaurus

I'm still rather new to doing complex Javascript development, so using this to eliminate onClick delay for a PhoneGap/jQuery Mobile app has been great. But I've run into an issue:

At the moment, this code doesn't seem to accommodate a taphold event. In my code, I bind to taphold for an item. But this never fires if I set a fastClick event for it as well. Ideally, I'd like to be able to have both co-existing, so a user can tap to go to a new page, or taphold to bring up a dialog.

Is this possible? If nothing else, could it not filter out touchstart events that have a touchend event after a set threshold? Just a thought. Thanks!

Example Code:

$('a.cat').bind('taphold', function (e) {
$( "#homeDialog" ).popup( "open" );
});

$('a.cat').fastClick(function(e) {
$.mobile.changePage("categoryPage.html", {transition: "slide"});
});

fastClick fires, but taphold does not, no longer how long the tap is held for.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions