简体   繁体   中英

Jquery hover menu not working for touch

I have a dropdown menu with 3 items. It uses jquery hoverIntent plugin and works perfectly on desktop browsers. But when it comes to iPad/tablet, if I touch on any of the menu item, it just activates that menu item. It doesn't slides down. If I try to touch again on it, nothing happens. But when I click on the other menu item, it works fine. That menu slides down properly and after that every other menu item also works properly. (even the first one I touched). Can anybody please help me out with this issue?

Hover is designed with the mind-set that the user is using a mouse and be able to move the pointer on top of the element without clicking!!

the touch environment has no hover .... it is either you touch or you don't with your finger!!

so you need to hack it ..

you can use jquery mobile which add a layer for touch event

you also need to specify custom html for touch event :

http://www.w3.org/TR/touch-events/

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