简体   繁体   English

我应该在列表页面上的过滤器之前添加跳过链接吗?

[英]Should I add skip links before filters on my listing page?

I have a listing page set up for a group of products and a set of filters on the left. 我在左侧为一组产品和一组过滤器设置了清单页面。 The filters appear before the products in the source order, therefore they are focused first when tabbing through the page. 过滤器按源顺序显示在产品之前,因此在浏览页面时,它们将首先聚焦。

The real page has about 15 different filterable options that the user will have to tab through before they arrive at the actual products they've searched for. 实际页面上大约有15种不同的可过滤选项,用户在到达所搜索的实际产品之前,必须先通过这些选项卡进行选择。

Should I add a skip link before the filters, to move users directly to the listing? 我是否应该在过滤器之前添加跳过链接,以将用户直接移动到列表中?

The structure of the page is similar to the below (simplified for posting here): 该页面的结构类似于以下内容(简化后在此处发布):

<div id="products">
    <div class="filters">
        <input name="keyword" type="text" value="">

        <input name="price_min" type="number" value="0">
        <input name="price_max" type="number" value="0">
        <!-- ...and others -->
    </div>

    <div class="listing">

        <div class="product">
            <h3>Product name</h3>
            <p>Lorem ipsum dolor sit amet, consectetur...</p>
        </div> <!-- /.product -->

    </div> <!-- /.listing -->
</div> <!-- /#products -->

I've set up a similar skip link at the top of the page, which skips to the main content - in this case, the next tab would place the user on the first filter input. 我在页面顶部设置了一个类似的跳过链接,该链接跳至主要内容-在这种情况下,下一个选项卡会将用户放在第一个过滤器输入上。

I've had a look at some other large retailer sites and they don't appear to have this functionality, requiring the user to tab through all of the filters first. 我看过其他一些大型零售商站点,它们似乎没有此功能,因此要求用户首先浏览所有过滤器。

Skip links (officially called " Bypass Blocks ") are fantastic. 跳过链接(正式称为“ 旁路块 ”)非常棒。 Thanks for implementing them. 感谢您实施它们。 They are normally the very first thing you encounter (first in the DOM) when you TAB into the webpage or navigate with a screen reader. 当您TAB进入网页或使用屏幕阅读器进行导航时,它们通常是您遇到的第一件事(在DOM中是第一件事)。

Most of the time there is only one skip link to jump to the main content and it sounds like you've done that. 大多数时候,只有一个跳转链接可以跳转到主要内容,听起来您已经做到了。 However, you can have several skip links at the beginning, just don't go overboard. 但是,一开始可以有几个跳过链接,只是不要太过分。 Perhaps 3 skip links is the max I would do. 也许3个跳过链接是我最多能做的。 So you could have something like this: 因此,您可能会遇到这样的事情:

<a href="#main">skip to main</a>
<a href="#results">skip to results</a>

Most skip links are hidden until they receive focus. 大多数跳过链接都是隐藏的,直到获得焦点为止。 If you're doing that and you have multiple skip links, then each link can become visible when it receives focus and then hidden when it loses focus (blurs). 如果执行此操作,并且有多个跳过链接,则每个链接在获得焦点时可以变为可见,而在失去焦点时会被隐藏(模糊)。 Both skip links can physically be in the same space on the page. 两个跳过链接实际上都可以在页面上的同一空间中。 That is, they don't have to follow each other horizontally like you would see in a normal navigation menu because you'll only see one at a time. 也就是说,它们不必像您在普通导航菜单中看到的那样水平地互相跟随,因为您一次只能看到一个。 It'll essentially look like when you tab , the text underneath your focus changed. 当您使用Tab键时 ,焦点下面的文本实际上会发生变化。

An alternative is to only have one skip link but instead of jumping to what you think is the main section (which may or may not be the <main> element or <div role="main">), it could jump to the results. 一种替代方法是仅具有一个跳过链接,而不是跳转到您认为是主要部分的部分(可能是或可能不是<main>元素或<div role =“ main”>),它可能会跳转到结果。 You can basically make the skip link jump to what you think is the "main" or most important part of your page. 您基本上可以使跳过链接跳到认为是页面“主要”或最重要部分的位置。

It's hard for me to recommend which solution to try because I don't know enough about the organization of your page, but you have two options. 对于我很难推荐尝试哪种解决方案,因为我对您的页面的组织了解不多,但是您有两个选择。

Presumably, the product filtering options would be of value to people who use assistive technology, but forcing people to review these options on every page load would also be overwhelming. 大概,产品过滤选项对于使用辅助技术的人来说是有价值的,但是强迫人们在每次页面加载时都对这些选项进行审查也将是压倒性的。

One option could be to include a dedicated skip link for " go to product filter " or something similar on pages that contain products. 一种选择可能是包括一个专用的跳转链接,用于“ 转到产品过滤器 ”或包含产品的页面上的类似内容。 You could then have another one for " go to main content ". 然后,您可以有另一个用于“ 转到主要内容 ”。 There's no limit to the number of skip links you can have, although it's probably best to keep the number as small as possible (I'd recommend 3 or less). 跳转链接的数量没有限制,不过最好将链接的数量保持尽可能小(我建议不超过3个)。

Another option could be to include the filter after the skip link, but have it collapsed in some sort of a menu that the user would need to expand before it could be accessed. 另一个选择可能是在跳过链接之后包含过滤器,但是将其折叠在某种菜单中,用户需要先展开菜单才能访问它。 This would give visitors the option of easily bypassing the control. 这将为访问者提供轻松绕过控件的选项。 If you use Bootstrap, something like a Dropdown , a Collapse , or a Nav component would probably work quite well. 如果使用Bootstrap,则DropdownCollapseNav组件之类的东西可能会很好地工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我应该在哪里添加JS事件以使我的链接工作? - Where should I add the JS event to make my links work? 我如何在组件加载到页面 Reactjs 之前更改我的菜单链接 - how do i change my menu links before component is loaded to page Reactjs 添加一些HTML链接后,jQuery清理我的页面视图 - JQuery cleaning my page view after I add some html links 我的承诺在我认为应该解决之前就已解决 - My promise is resolving before I think it should 为什么在IE上,当我在页面重新加载之前将其添加到dom时,我的覆盖图没有显示? - why on IE my overlay is not showed when i add it to the dom before a page reload? 我应该在我的Web应用程序的每个html页面中添加Google Analytics(分析)摘要吗? - Should I add the google analytics snippets in every html page in my web application? 在角度加载我的单页应用程序之前添加加载页面 - add loading page before angular loads my single page app 如何在加载报告之前添加过滤器 - How to add filters before loading reports Quickfilter 应该为过滤器列表增加价值 - Quickfilter should add value to list of filters 我想在我的PHP页面的选择菜单中的选择选项上添加一些文本框。 这应该是动态的(没有展开页面) - I want to add some textboxes on selecting option from select menu in my PHP Page. This should be Dynamically(without reloding page)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM