Question

I have the following script code designed to capture double tap events so I can toggle an image between a size that fits on the page and full size. The problem is that the tap event is not firing at all in Safari browser running on iPhone 4. In the below code, the alert never displays regardless of what I do on the touch screen.

$(function () {
  $('#showImage').on('tap', function (event) {
    alert("gets in tap event");
    var d = new Date();
    var tapTime = d.getTime();
    if (tapTime - lastTapTime > 500) {
      lastTapTime = tapTime;
    }
    else {

      toggleResize();

    }
  });
});

Why isn't this working?

Était-ce utile?

La solution

tap event is now working. I had some script code on an earlier page that was breaking the script code on this page. When I removed the earlier script code, this script code started working again.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top