开发者

control browser tab index

I'm building a window widget using Javascript, when the window is focused, I want the tab control only stay inside the window widget not jump back to the browser. is there any tab index which I can use use t开发者_StackOverflow中文版o control it?


This looks like a similar situation to the people who ask how to disable the back button.

You can't really do it, and you wouldn't want to. Your scope as a web developer does not extend to changing the behaviour of core behaviours of the user's web browser, and even if you could you wouldn't want to, because it would have only impede usability and accessibility.

When you write a web application you can't know if it's going to be used by a traditional desktop web browser or any other tool, including an accessibility tool for the disabled. You therefore cannot make assumptions about how users view the page, how they select links and then follow them, etc.

Browsers tend to let websites specify the order in which the tab key should select fields, but they don't let you disable certain fields from being reachable via the tab key, nor should that be a feature in browsers.

You could, if you wanted to, load the widget in its own page, so that the other controls you want to remove from the tab order simply aren't on the page anymore.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜