I have a dropdown which uses CSS a#hoverlink:hover+div
to make a div to appear, then you can click a link in the div.
On Android, when you click the hoverlink, it triggers :hover
so this works fine.
I heard this isn't working in an iPad. How can I make it work? I'm thinking using :focus
as an alternative to :hover
would do the job. Will clicking trigger :focus
in iPad safari?
I would just test it, but I don't have an iPad to try it with:
a#hoverlink+div { transition: all 2s; }
a#hoverlink:not(:focus)+div { visibility: hidden; opacity: 0; }
<a href="javascript:" id="hoverlink">the link</a><div> yes! focus worked, now wondering if click works<br/><a href="javascript:" onclick="alert('great, it worked!')">click here!</a></div>