Multiple forms on one HTML page: how to restrict tabbing to a single form?

前端 未结 4 769
[愿得一人]
[愿得一人] 2021-01-08 00:28

The site I\'m currently building is a little different from the norm. Instead of having multiple separate pages, all site content is on a single index.php file, and using ab

4条回答
  •  太阳男子
    2021-01-08 01:04

    The site I'm currently building is a little different from the norm. Instead of having multiple separate pages, all site content is on a single index.php file, and using absolute positioning and javascript the user "pans" across the site from page to page.

    Here's an alternate approach that might side-step this issue, and could end up being more accessible.

    I'm assuming you have some elements on that page that you use to trigger the panning from one sub-page to the other?

    If so, basic idea here is that when any page is "scrolled off", hide that 'sub-page' (presumably some container DIV) with display:none or visibility:hidden.

    The key issue here is that content hidden with either of these two methods is non-tabbable, so the user can't accidentally tab into those hidden pages. Also importantly from an accessibility point of view, screenreaders know to ignore content that's marked up this way, so they will only read the current page (which is consistent with what a sighted user sees), not the entire page.

提交回复
热议问题