SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: Tab through TRs

  1. #1
    SitePoint Addict sdleihssirhc's Avatar
    Join Date
    Feb 2009
    Posts
    387
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Tab through TRs

    I have a site which is basically just going to present some information in the form of tables. To make it a little more interesting, I'm adding hover and click functionality to the TRs.

    But then I wondered about people who just keyboards. Would it be cool to allow them to tab through the TRs, as if they were hovering with a mouse? And to trigger the "click" function when they press "enter"?

    And now I'm considering people with screen readers. If I did add that tab/enter fallback, would that make navigating the page too cumbersome? After seeing this YUI video on accessibility, I wonder if a better way to do it would be to allow the user to tab to the table, and then use the up/down arrow keys to navigate.

    After all of this, I've come full-circle and decided that I'm really over-thinking it. There are already perfectly convenient navigational methods available to the mouse-less and screen-readees. The hover and click things are just flourishes that I shouldn't worry about reproducing.

    What does everyone else think?

  2. #2
    SitePoint Wizard
    Join Date
    Dec 2003
    Location
    USA
    Posts
    2,582
    Mentioned
    29 Post(s)
    Tagged
    0 Thread(s)
    I think it depends on exactly what you're making.

    If you're making a CMS or some other web application, adding your own navigation methods might not be a bad idea if they really give you productivity benefits.

    However, if you're just creating some table with data in it, I think you should leave it to the more default manners of handling it, since learning new behaviors isn't likely to be more productive.

  3. #3
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    I'm just trying to figure out why you'd put it on the TR -- and of course laughing at how bad the site in question would break for all the people who actively block javascript. (see the various noscript users who pop up here from time to time)

    I'd have to see what it is you are trying to do, but it sounds like a total and miserable accessibility /FAIL/ just from what you've said so far.

  4. #4
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    SDL, I think you are making the hover show up using CSS correct? If so, the CSS equivelent to hover for keyboard users, is :focus. The click may work depending how it is used. (As a keyboard user, I can test)

    If not, you need to explain more what you are doing with these...

    Quote Originally Posted by SDL
    And now I'm considering people with screen readers. If I did add that tab/enter fallback, would that make navigating the page too cumbersome? After seeing this YUI video on accessibility, I wonder if a better way to do it would be to allow the user to tab to the table, and then use the up/down arrow keys to navigate.
    It might be too much with the pop ups, depending on what they do, info they give etc. Screen readers, i know JAWS the best, have hotkeys once in the table. This is dependent on the user's level. Basic users will read the tables LTR, top to bottom. Advanced users know how to jump by table headings etc.
    Ryan B | My Blog | Twitter

  5. #5
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    SDL, I think you are making the hover show up using CSS correct? If so, the CSS equivelent to hover for keyboard users, is :focus. The click may work depending how it is used. (As a keyboard user, I can test)
    :focus does not work correctly (at all) in IE6 or 7, which may still be popular with users of older Windows screen readers.

    :focus does not work on elements without a natural focus ability (which would be anchors and form controls). So, not tr's.

    (on)click events can be placed on any element of any type; however if the element is not naturally focus-able, then keyboarders will not be able to reach it unless you've also had Javascript add a negative tabIndex (which will allow you to first put focus() on the element before click()).

    OP: if this flourish isn't really adding anything, don't make it more complicated for everyone else. Sometimes it's ok to just have something for mouse-users only, because it's an enhancement (got a mouse? yay you get to do something cool/weird/stupid/cute) and not essential.

    Screen readers differ in how good they are at showing DOM updates done by Javascript, and this assumes the user hasn't turned Javascript off due to any problems it has caused with their reader. Newer readers tend to be better with DOM updates, in general. If this is done with CSS, then it's presentational anyway and users of text browsers and screen readers and whatever else shouldn't notice its absence or presence either way.

  6. #6
    SitePoint Wizard rguy84's Avatar
    Join Date
    Sep 2005
    Location
    Durham, NC
    Posts
    1,659
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Stomme poes View Post
    :focus does not work correctly (at all) in IE6 or 7, which may still be popular with users of older Windows screen readers.

    :focus does not work on elements without a natural focus ability (which would be anchors and form controls). So, not tr's.
    Also use :active, however the rest of what Stomme says is spot on.
    Ryan B | My Blog | Twitter

  7. #7
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,283
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    :active acts like :focus in IE6, so for that reason I'll have :active with :hover and :focus for styles in general... IE7 fixed :active but didn't provide a fixed :focus, so there's no non-javascript way around IE7 (bleh). At least IE8 fixed :focus.

    Hm, we developers are already looking forward to IE9 and all the sweet new HTML5/CSS3 junk it'll support... yet my userbase will likely remain using WinXP for a long time, and IE6 still doesn't drop below Opera or Safari user levels... sigh...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •