Ask your Question

PEOPLE YOU MIGHT KNOW

Mansi
Mansi

One stop solution for all digital marketing needs!

West Chester,  United States
Impressico
Impressico

New York,  United States
Vpro
Vpro

Vpro Infotech

Ludhiana,  India
Eecrets
Eecrets

MAGENTO CUSTOMIZATION. DEVELOPMENT AND INTEGRATIONS

Varanasi,  India
Wedding
Wedding

Wedding Limo Services Company in Toronto

ON,  Canada

Write to us

Ask Question

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

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();
});

0   0
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