E-mail List Archives
Re: Does this Javascript bring focus to expanded content?
From: Jared Smith
Date: Feb 8, 2012 11:00AM
- Next message: Birkir R. Gunnarsson: "Re: Does this Javascript bring focus to expanded content?"
- Previous message: Angela French: "Re: Link to PDF best practise"
- Next message in Thread: Birkir R. Gunnarsson: "Re: Does this Javascript bring focus to expanded content?"
- Previous message in Thread: Angela French: "Does this Javascript bring focus to expanded content?"
- View all messages in this Thread
In order for the <div>s to properly receive focus with JavaScript,
they should be given tabindex="-1".
For something like this, setting focus may not be the best. This is
even more problematic in this case because if the user activates the
links when the content is already revealed, it will hide the content
and then try to set focus to it (which is impossible because it has
just been styled with display:none). Additionally, the link text
("Reveal X") isn't accurate if the text is already revealed.
Because you are simply toggling the visibility or expansion of the
items, I'd think that giving the links role="button" and then simply
toggling the aria-expanded attribute on the links from true/false
would be a much better experience. The user would be informed of the
status of the content (whether it is expanded or not) and can toggle
it on or off from the link. Because the content is immediately after
the control, the user would simply start their screen reader reading
or tab into the content to access it.
Jared
- Next message: Birkir R. Gunnarsson: "Re: Does this Javascript bring focus to expanded content?"
- Previous message: Angela French: "Re: Link to PDF best practise"
- Next message in Thread: Birkir R. Gunnarsson: "Re: Does this Javascript bring focus to expanded content?"
- Previous message in Thread: Angela French: "Does this Javascript bring focus to expanded content?"
- View all messages in this Thread