Ask your Question

PEOPLE YOU MIGHT KNOW

Pooja
Pooja

Chiplun,  India
Everest Educational
Everest Educational

Visa Consultants in Punjab

Ludhiana,  India
Vikas
Vikas

Web developer

Gurgaon,  India
Space
Space

Courier Services

Birmingham,  United Kingdom
MobileComm
MobileComm

MobileComm Professionals Inc.

Richardson,  United States

Write to us

Ask Question

Preventing ghost click when binding touchstart and click(Ghost clicks in mobile browsers)

Shailesh Kumar

What is ghost Clicking?
In any touch device, mobile browsers emulate click events when the screen is touched.

 

What happend when the screen is taped?

A touchstart event is fired as soon as a finger touches the screen.A touchend event is fired as soon as the finger leaves the screen, then the browser waits around 300ms for another tap.If not, a click event is fired. This is the ghost click.

 

How to Prevent this?

$('#div').on('touchstart', function(e) {
    alert('touch');
    e.preventDefault();
});

Shailesh Kumar

Please rotate your device

We don't support landscape mode on your device. Please rotate to portrait mode for the best view of our site