简体   繁体   中英

Clear/Reset hover state in touch screen devices

Any suggestions on how i can reset/clear a hover state that is activated within a touch screen device like an ipad.

I have some tooltips that show on hover that's actually a click within the ipad due to how it deals with a hover.

But is there is a way to set it so the hover state gets reset to normal. As the problem is the tool tip won't re show as it still thinks it's being hovered. Clicking on another tooltip, then back on it works.

Edit: Very basic JSfiddle to demonstrate the issue, needs to be viewed within a ios device to see problem.

hover(click when in ipdad) the box will appear and then disappear. Try hovering/clicking again and it won't re appear within a touch devices, unless you then hover/click on another tooltip and then back to that one.

Depending on how the tool tip is implemented, it might be a good idea to just put a timeout on it. Then after 10 seconds or so it just hides and resets itself. If you add your code we could help with a specific recommendation.

EDIT:

I added mousedown to your jquery events and it seems to work as you wish now on ipad. See updated fiddle .

$('.tooltip').on('mouseenter mousedown', function(e){

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM