如果我有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.
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.