Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6572937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:04:08+00:00 2026-05-25T15:04:08+00:00

I have a jquery / phonegap app, and everything is good and fast and

  • 0

I have a jquery / phonegap app, and everything is good and fast and working except for one small item. the first initial vclick, tap whatever is picked up twice. after you have done the first one, everything is okay. I have tried all sorts like e.preventDefault(); in many places and tried pr-loading pages but still no matter what i always get that initial double click.

here is sample ecmascript

$('nav[id="homeList"] div[data-cust="homelink"]').live("vclick",function(e){
    e.preventDefault();

    var over = $(this).attr('data-over');

    if(over !== undefined){ $(this).addClass(over); }
    var pageTo = $(this).attr('data-pagename');

    Log( 'Page to: ' + pageTo );

    if(pageTo !== undefined){
        $.mobile.changePage("#" + pageTo);
        if(over !== undefined){ $(this).removeClass(over); }
    }

    //e.preventDefault();
});

here is sample HTML:

<div class="ui-listitem">
        <div class="block sprite2 binbox relat" data-pagename="inbox" data-over="binboxover" data-cust="homelink"></div>
     </div>

the nav with id of homeList is just my html5 tag that all the ui-listitems sit inside
really puzzled, but am sure someone knows how to maybe cancel out this strange behaviour .

thanks

p.s i have looked at other double click / double event fireing on here but they relate to something that happens over and over, i must stress that this is only for the first time

I have found some sort of fix, but if you click the same location it cancels your click
i have tried setting some kind of global variable but that would mean every tap would have to be registered with the global, so the global holds the last click location and therfor cancelling my initial buttons click location. have also thought that if there is a global click location then there is no need to check but that wont cancel the first it will just prevent the rest, anyway here is the code that cancels, but prevents:

            var lastClick = $( this ).attr( 'data-lastclick' ),
        curClickPoint = e.clientX+'x'+e.clientY
        if( lastClick === curClickPoint) return false;
        $( this ).attr( 'data-lastclick', curClickPoint );

okay came up with a final solution:

set a global

var hasDoneFirstClick = false;

in the same function as above i have used this code:

if ( !hasDoneFirstClick ) { 
        hasDoneFirstClick = true;
        return false;
    }

it is only the initial click that is doubled so i just ignore the first ever click / tap !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:04:08+00:00Added an answer on May 25, 2026 at 3:04 pm

    I’m not sure this answers you question but jQueryMobile in Beta 2 opted to use click instead of vclick. You can read the release notes on this:

    • http://jquerymobile.com/blog/2011/08/03/jquery-mobile-beta-2-released/

    Quote:

    Backtrack: We’ve switched back from vclick to click for links

    In Beta 1, we decided to use our custom vclick event for handling Ajax
    links to improve responsiveness and to hide the URL bar on the iPhone
    and Android phones. Even though we did quite a bit of testing before
    landing this for Beta 1, we began to hear feedback that this change
    was causing some significant issues out in the wild including:

    • Multiple click events causing navigation and form element issue –
      In certain situations, when tapping an element, tap/click events
      seem to fire twice on links and is due to edge cases where the
      target of the touch event and mouse event don’t match due to how
      the browsers calculate tolerances for these events. This is most
      pronounced on Android 2.1, but affected most WebKit-based browsers
      to varying degrees when a tap events occured near the edge of an
      element.

    • Click handlers in custom scripts didn’t “work” anymore – if a
      script bound only to click events on the document, the global
      vclick feature could interfere because the touch events may
      supercede click events so it events wouldn’t appear to trigger.
      Based on a lot of detailed testing and analysis, we’ve decided to
      roll back to using standard click events on links instead of using
      the custom vclick event because it’s the only reliable way to
      support all our target browsers. There are two important things to
      note in this change:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay I have a small app for uploading an image (using phonegap, Jquery). I
I have some strange scrolling problems with my PhoneGap (using jQuery Mobile) app: I'm
I have a simple app developed with jQuery Mobile and implemented in PhoneGap. It
I have PhoneGap-Android app and I am using Jquery. I am doing ASYNCHRONOUS AJAX
I have PhoneGap app in Android using jQuery. Sometimes I need to upload some
I have a jquery mobile app that i am wrapping in Phonegap for Iphone/Android
Jquery Mobile Transition effects have a clumsy behavior in Android PhoneGap app.The same transitions
I'm making an PhoneGap app using Jquery Mobile, but I have a little problem
I am writing a jquery phonegap quiz app and have a number of categories
I'm writing a quiz app using phonegap & jquery. I have a number of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.