My div is designed to expand when clicked using jQuery $('.mydiv').click
, and collapse with a second click.
In addition, the same div showcases more information on hover due to CSS rules utilizing :hover
. This feature works perfectly on a computer.
Interestingly, on iOS devices, the click functionality not only triggers but also activates the :hover
pseudo-class, revealing the extra info as intended. This unexpected behavior is actually quite ideal.
However, simply having a :hover
pseudo-class in the CSS doesn't guarantee that a click will reveal it. So, what guidelines does iOS follow in applying or omitting the :hover
state?
I prefer not to conceal functions under hovers and resort to writing touch-specific JavaScript just to make them operational. It appears that iOS is already handling some of this work for me. I am curious how to utilize this functionality intentionally rather than stumbling upon it accidentally!