Firing Event Only Once

Firing Event Only Once

Hi, I'm trying to understand how to get (on singletap) to fire more than once in a mobile browser.  I'm using jQuery-Mobile-Events plugin w/ jQuery, but it's only firing once.  I added a little mobile console script & it keeps logging "Single tap called" which is maddening - the line before should be running on every single tap, but it isn't.  This function is outside of the doc ready handler.

  1. $(function() {
  2.   $(".vppop").on('singletap', function() {
  3.     $(".vppop").addClass("vppopscale").delay(1500).removeClass("vppopscale");
  4.     console.log('Single tap called');
  5.   });
  6.   $(".vppop").on('click', 'a', function(e) {
  7.     var hasTouch = 'ontouchstart' in window;
  8.     if (hasTouch) {e.preventDefault();}  // Prevents link following on single tap
  9.   });
  10.   $(".vppop").on('doubletap', function() {
  11.     console.log('DoubleTap Called & Link Followed');
  12.   });
  13. });

Questions:
1) The singletap only works 1 time, how do I get it to work an unlimited number of times?
2) How do I get doubletap to follow the link?
3) In iOS Simulator, on tap hold: Open button doesn't seem to go to link, while Open in New Page works. Why doesn't Open work?

Thanks for the assistance.
Bill
    • Topic Participants

    • bill