简体   繁体   中英

How to make the ul HTML list navigation using Keyboard arrows

如果我有HTML ul列表,如何在键盘中使用箭头允许列表导航?

Give your ul and li, a tabindex value so that they are focusable. Once this is done, you can catch key events for the same and handle your navigation accordingly. Or if you have an <a> inside each <li> , you can skip the tabindex part and go straight to handling key events for the <a> element.

使用jQuery的一个工作示例按键导航

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