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
profile Jewel Galore 22nd January 2024

Explore the world of  artificial jewellery online  at Jewelgalore. Discover their exquisite collection of affordable yet elegant pieces, perfect for expressing your unique style.

Write a comment ...
Post comment
Cancel
profile Shalamar Hospital 22nd January 2024

Shalamar Hospital, your trusted  cardiology hospital Lahore , is dedicated to the heart health of the community, delivering top-quality cardiac care and expertise.

Write a comment ...
Post comment
Cancel
profile OSH 22nd January 2024

Osh University's commitment to medical education extends to  osh kyrgyzstan , ensuring our students are well-versed in this essential field of study. It's a key component of our comprehensive medical curriculum.

Write a comment ...
Post comment
Cancel
profile Rafat 10th September 2023

Rafat Law Associates is a prominent law firms in Islamabad, known for its exceptional legal services and expertise. With a dedicated team of skilled lawyers, they offer a wide range of legal solutions to clients.

Write a comment ...
Post comment
Cancel
profile Mohagni 9th September 2023

Mohagni is renowned for its exceptional collection of ladies trouser design available for online purchase in Pakistan. With a diverse range of products to choose from, Mohagni ensures that customers have access to the best designs.

Write a comment ...
Post comment
Cancel
profile Shahtaj 9th September 2023

Shahtaj Qaiser offers a wide range of party wear dress in Pakistan. Discover the latest party dresses with various designs at low price. Grab your favorite dresses online today!

Write a comment ...
Post comment
Cancel
profile Shahtaj 9th September 2023

Shahtaj Qaiser offers a wide range of party wear dress in Pakistan. Discover the latest party dresses with various designs at low price. Grab your favorite dresses online today!

Write a comment ...
Post comment
Cancel
profile Walkeaze 9th September 2023

Step up your fashion game with Walkeaze latest collection of High Heels shoes for women. With a wide range of shoes, including high heels and wedge heels, we have something for women. So, get your favorite heels today.

Write a comment ...
Post comment
Cancel
profile Chahyay 9th September 2023

Enhance your natural beauty with the Chahyay lip gloss and lip tint collection. Our high-quality formulas offer a range of stunning shades that leave your lips pleasing and radiant. Shop now for the perfect Lip gloss and tint from Chahyay.

Write a comment ...
Post comment
Cancel
profile servis 8th September 2023

Shop the latest collection of stylish and comfortable Pumps Shoes for Ladies at Servis. Our pumps are designed to keep your feet looking chic and feeling great. Browse our range now and find the perfect pair for any occasion

Write a comment ...
Post comment
Cancel
profile House of 8th September 2023

Shop for unique and elegant floral jewellery from our wide selection of designs. Our handcrafted pieces are perfect for any occasion and feature a variety of materials including gold, silver, pearls, crystals, and more. Find the perfect piece today!

Write a comment ...
Post comment
Cancel
profile The 8th September 2023

Looking for baby toys online in Pakistan? The Entertainer offers an amazing collection of baby walker, toys, bouncers, and chair of the best quality. So, Shop Now for Baby toys online from The Entertainer.

Write a comment ...
Post comment
Cancel
profile Adoro 8th September 2023

Discover the latest women shoes in Pakistan that perfectly merge fashion and comfort. Everything from traditional to modern, is covered by our collection, taking you one step forward in grace. Shop now!

Write a comment ...
Post comment
Cancel
profile Meerak 7th September 2023

Are you looking for the latest embroidered dresses online in Pakistan? So, come to Meerak online and get the latest embroidered dress online in all over Pakistan at reasonable prices with quick delivery.

Write a comment ...
Post comment
Cancel
profile Borjan 7th September 2023

Looking for school shoes for kids in Pakistan? Borjan offers their customer the best ToT Ba ToT collection for kids that include school shoes. so, shop now for the best kids shoes online at Borjan

Write a comment ...
Post comment
Cancel

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