johnsmith153 — 2012-09-13T02:06:46-04:00 — #1
I am using JS to add a class to an element when it is hovered over.
I also want to remove that class when the element is no longer hovered over.
How do you do this?
I also want to ensure it works on touch devices as well as with the mouse.
I don't want to use jQuery (or any library).
paul_wilkins — 2012-09-13T04:01:54-04:00 — #2
With the touch devices (such as the ipad), some touch devices trigger the hover event when you first click, and then a second click on an item triggers the click event.
Can you give more details of your needs in respect to the touch devices?