Howdy_McGee
Howdy_McGee

Reputation: 10635

Tab Index Relative to User View

I'm optimizing my website to be accessible to everybody first starting with tabbing. I has a hidden link that appears on :focus which is the very first link. The purpose of the link is to "Jump To Main Content" which I thought was a cool feature to add in. The problem with this is even though it jumps the user to the main content, if they tab their screen jumps right back to the top of the page...

Is there such a thing as tabbing relative to where the top of the users screen is?

I was thinking of using JQuery and adding the tabindex attribute to the closest link once they jump to the main content but I wasn't sure how SEO would handle that. Since it is being added dynamically theoretically it should be ignored by search engines and would never see my tabindex starting in the middle of my page. From a SEO or Accessibility standpoint, is there anything wrong with this approach? Is there a better approach?

For people to get a better idea of what I mean I've created a JSFiddle - you have to click the Display box then tab through it to get the "Jump To Main Content" link to show. Though when I add a tabindex dynamically it gets ignored.

Upvotes: 0

Views: 186

Answers (1)

AlastairC
AlastairC

Reputation: 3297

You've run into a bug in Blink/Webkit where the keyboard focus doesn't move when you follow in page links, I answered that here: Uptating keyboard focus when implementing the skip to main content technique through an anchor link

I would completely avoid trying to do dynamic tabindex, it is not needed and will almost certainly break when you update things in future.

Upvotes: 1

Related Questions