javascript - Css Hover on touch enabled devices using touchstart and touchend -


i have simple website has few :hover effects in it, placed on div's, not links. need make these effects visible on ipad.

i using 'touchstart' in header:

<script> document.addeventlistener("touchstart", function(){}, true); </script> 

which job... on ipad, when touch div, mouse on (hover) effect displayed. when touch anywhere outside of div, effect reversed (mouse out).

however, need effect reverse if tap on same div again...

anyone able help? thanks! m


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -