How to solve the problem of a link on iPhone not responding without pressing a link twice

Touch screen devices, such as the iPhone, sometimes have problems with a-links not responding unless they are tapped twice. This may be due to the hover effect or other factors.

One solution to this problem is to add an ontouchstart attribute to the HTML tag. Specifically, do the following

<body ontouchstart="">

This will cause an event to fire the first time a touch operation is performed and allow the link to function properly.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top