是否有无法解决超链接的Safari/Opera错误的解决方法? [英] Is there a workaround to Safari's/Opera's bug that you can't tab through hyperlinks?

查看:143
本文介绍了是否有无法解决超链接的Safari/Opera错误的解决方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我使用的IE,Firefox,Chrome和大多数基于Windows的界面中, Tab 键可用于从一个表单字段或超链接导航到下一个(例如可操作的"项目)(注意:我尚未在其他操作系统上进行测试)

In IE, Firefox, Chrome and most Windows-based interfaces that I've used, the Tab key can be used to navigate from one form field or hyperlink to the next (e.g. "actionable" items) (note: I have not tested on other Operating Systems)

但是,当进行制表时,Safari和Opera会跳过网页中的所有超链接.恕我直言,这是一个 usability 错误,但我离题了.

However Safari and Opera skip all hyperlinks in a web page when tabbing. IMHO its a usability bug but I digress.

是否有变通办法/黑客使Safari和/或Opera浏览这些链接?

Is there a workaround/hack to make Safari and/or Opera navigate through these links?

我注意到,如果设置了例如,Opera将接受tabindex属性. tabindex="0"因此在页面上的DOM流中保持链接索引" ...但是Safari不想接受它.

I've noticed that Opera will accept the tabindex attribute if set e.g. tabindex="0" thus maintaining the links "index" within the flow of the DOM on the page... but Safari does not want to accept this.

对于那些感兴趣的人来说,jQuery的这一点将使所有超链接成为可标签的.

For those interested, this bit of jQuery will make all the hyperlinks tabbable.

//Make links 'tab-able' in Opera
$(document).ready(function(){
  if($.browser.opera){
    $('a[href]').attr('tabindex', 0);
  }
});

...虽然这似乎适用于Opera,但是还有更好的解决方法吗?

...and although this seems to work for Opera... is there a better workaround?

推荐答案

在Safari中,这不是错误,而是可选功能.在Mac上,标签会选择链接以外的对象,而Option + Tab则会选择所有对象.您可以在首选项"->高级"中交换这些快捷方式的行为.然后,Tab的行为就像在其他浏览器中一样.

In Safari, it's not a bug, it's an optional feature. On the Mac, tab selects objects other than links, Option+Tab select all objects. You can swap the behavior of these shortcuts in Preferences->Advanced. Then tab will behave like in other browsers.

在Windows上,Option + Tab不可用.默认情况下,选项卡选择链接以外的对象,但是在首选项"->高级"中有一个选项使选项卡选择所有对象.然后,Tab的行为就像在其他浏览器中一样.

On Windows, Option+Tab is not available. By default tab selects objects other than links , but there is an option in Preferences->Advanced that makes tab select all objects. Then tab will behave like in other browsers.

您可能不应该尝试对此进行干扰,因为这会干扰用户的偏好.

You should probably not try to interfere with this, as you would interfere with the user's preferences.

这篇关于是否有无法解决超链接的Safari/Opera错误的解决方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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