跳过链接在Chrome中不起作用 [英] Skip links not working in Chrome

查看:133
本文介绍了跳过链接在Chrome中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我查看了此前问题但可惜的是,它似乎并没有提供任何解决方案(除了JS,这是一个非初学者恐怕)

First of all, I've looked at this previous question but sadly it didn't seem to offer any solutions (other than JS which is a non-starter I'm afraid)

我有一些跳过链接在我的页面顶部...

I've got some skip links at the top of my page...

<ul>
<li class="skip-link"><a href="#mainContent" accesskey="S"><span>Skip to main content</span></a></li>
<li class="skip-link"><a href="#main-navigation" accesskey="N"><span>Skip to main navigation</span></a></li>
</ul>

,还有...

<div id="mainContent"></div>

这是一个空的div纯粹作为锚点。

which is an empty div purely there to act as an anchor point.

链接激活时,一切似乎都正常工作;视觉上页面跳下,焦点转移到#mainContent之后的第一个链接。

Everything seems to work fine when the link is activated; visually the page jumps down, and focus shifts to the first link after #mainContent.

但是在Chrome(v 12.0.742.91)焦点没有,这意味着激活访问键后,再次标签只会跳回到页面顶部,并返回到访问链接。

However in Chrome (v 12.0.742.91), whilst the page visually shifts down, the focus does not, meaning that after activating the accesskey, tabbing again merely jumps you back up to the top of the page and back into the access links.

我有一个相同的问题,IE被放到一个已知的怪癖,并通过设置目标元素的特定宽度来修复。但是,这似乎并不适用于Chrome。我也试过添加一个tabable元素到#mainContent div,放置任何类型的内容在#mainContent div,以及各种float / width / height变体,似乎没有任何修复它。

I had an identical issue with IE which was put down to a known quirk and was fixed by setting a specific width to the target element. However, that doesn't seem to work for Chrome. I have also tried adding a tab-able element into #mainContent div, putting any sort of content in the #mainContent div, as well as all sorts of float/width/height variations and nothing seems to fix it.

有人在Chrome上遇到过类似的问题,或者知道修复程序吗?

Has anyone had any similar issues with Chrome or knows a fix?

感谢先生

Simon

推荐答案

你可以做的最好的,直到有人找到一个招/ 此问题已成功通过这一个
您的同事可能会这样做,因为他们关心

The best you can do until someone find a trick/hack is starring this issue which succeeded this one. Your SO fellows will probably do the same because they care.

显然, href =https://bugs.chromium.org/p/chromium/issues/detail?id=454172#c22 =nofollow>固定。

Apparently, it has finally been fixed.

这篇关于跳过链接在Chrome中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆