javascript - OnClick 键盘中的 Tab 按钮未突出显示 DOM 中的所有按钮或超链接
问题描述
这里有一个要求,当我们点击 Tab Button 然后在浏览器上它应该突出显示所有超链接 ToolTip 和按钮,因为在某些情况下,当点击 om tab 键时,它会跳过 DOM 的某些部分并跳过按钮的某些部分. 如何实现这一目标
`<div class="tech-section" id="specs-1-0-0">
<div class="row heading-row">
<div class="col-xs-12 col-sm-8 col-md-8 col-lg-9 col-xl-9">
<h3>Essentials</h3>
</div>
<div class="hidden-xs col-sm-4 col-md-4 col-lg-3 col-xl-3 export-container">
<a class="export-link" role="button" data-user-exit="SingleExport">Export Specifications
<span class="fa-arrow-right"></span></a>
</div>
</div>
<div class="row tech-section-row">
<div class="col-xs-6 col-lg-6 tech-label">
Collection
</div>
<div class="col-xs-6 col-lg-6 tech-data">
9 Series
</div>
</div>
<div class="row tech-section-row">
<div class="col-xs-6 col-lg-6 tech-label">
Code Name
</div>
<div class="col-xs-6 col-lg-6 tech-data">
<a href="https://something.html">Mansion Beach</a>
</div>
</div>
<div class="row tech-section-row">
<div class="col-xs-6 col-lg-6 tech-label">
Capacity
</div>
<div class="col-xs-6 col-lg-6 tech-data">
1.5 TB
</div>
</div>
<div class="row tech-section-row">
<div class="col-xs-6 col-lg-6 tech-label">
Status
</div>
<div class="col-xs-6 col-lg-6 tech-data">
Launched
</div>
</div>
<div class="row tech-section-row">
<div class="col-xs-6 col-lg-6 tech-label">
Launch Date
<button class="btn-tooltip-trigger view-modal info-modal" data-toggle="modal" data-target=".upe-modal" data-title="Launch Date" data-description="The date the product was first introduced." data-search-title="Find products with Launch Date" data-search-href="" data-search-icon="true">
<span class="fa-tooltip"></span>
</button>
</div>
<div class="col-xs-6 col-lg-6 tech-data">
Q3'18
</div>
</div>
<div class="row tech-section-row">
<div class="col-xs-6 col-lg-6 tech-label">
Lithography Type
</div>
<div class="col-xs-6 col-lg-6 tech-data">
3D
</div>
</div>
</div>`
就像我们有一些页面:现在,当我单击页面上的选项卡然后从标题开始时,现在当涉及到上述循环时,它会突出显示所有部分,同时单击 Tab 键会突出显示该行<a href="https://something.html">Mansion Beach</a>
,但是当再次单击选项卡时它会移动出此并转到页脚
相反,它还应该突出显示启动日期,即我们可以在底部看到一个按钮
<button class="btn-tooltip-trigger view-modal info-modal" data-toggle="modal" data-target=".upe-modal" data-title="Launch Date" data-description="The date the product was first introduced." data-search-title="Find products with Launch Date" data-search-href="" data-search-icon="true"> <span class="fa-tooltip"></span> </button>
但它没有突出显示。
任何人都可以帮助我了解这个“tab key press”如何工作以及如何解决上述问题的概念
解决方案
您可以检查是否text-decoration: none
在选项卡突出显示不起作用的那个元素的 :focus 或 :focus-visible 上实现了?
注意:Internet Explorer 和 Safari 不支持:focus-visible。
推荐阅读
- git - 我可以使用 SSH 向 Github 进行身份验证,但是在尝试推送到我的仓库时我得到了一个权限被拒绝
- algorithm - 最终位移的总和(以 0 开头的字符串 + 以 1 开头的字符串)如何总是等于 num_zeroes * num_ones?
- python - Python 格式化字符串文字返回“SyntaxError:无效语法”
- single-sign-on - 使用 SSO 和基于浏览器的登录从 Python 连接到 Snowflake
- html - 如何在边框线和边框上方的对象之间添加空格 [html]
- sql - 如何将带有标识列及其值的表数据和结构复制到同一数据库中的另一个表(只需更改表名)
- ios - 'exported: true' 在 Xcode 12.5 中的 '_specialize' 属性中无效
- python - 尝试从文本文件向 Telegram 发送消息
- sql - 仅在特定日期之后获取即时版本的条件查询
- java - 获取输入流中 STX 和 ETX 之间的字符串/字节