SitePoint Sponsor

User Tag List

Results 1 to 12 of 12
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2011
    Location
    The land of nod
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using Accesskeys query ?

    Ive got the UK government recommended list that being :

    s - Skip navigation
    1 - Home page
    2 - Newsroom
    3 - Site map
    4 - Search
    6 - Help
    7 - Complaints
    8 - Terms and conditions
    0 - Access key details

    I have assigned the relevant accesskeys to my main navigation <a> links, but I still cannot get access via the keyboard to the designated pages.
    I understand that different browsers use different key pairing, but with all the variants not working in either browser then I assume Ive made a boo boo with my HTML.I have tried all of the following keyboard processess and none of which work on either Firefox or IE:

    shift + "x num"
    ctrl shift + "x num"
    alt + "x num"
    alt shift + "x num"

    Have I missed something else out with my HTML ?

    example HTML code :

    <a href="http://www.website.com/faq_html" accesskey="5">faq</a>

    To use the skip navigation where out of interest do I place the "accesskey="s" ?

    Thanks all


  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,214
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by benisjamin View Post
    <a href="http://www.website.com/faq_html" accesskey="5">faq</a>
    That works fine for me in FF. On a Mac, it's Control + 5 (but I don't know about Windows, I'm afraid. It should be easy to look up on the FF website, though.)

    To use the skip navigation where out of interest do I place the "accesskey="s" ?
    You might as well combine it with a Skip link at the top of the page:

    Code:
    <a href="#content" accesskey="s">Skip to Content</a>
    The problem with accesskeys is that there's no good way to let people know they exist. So I prefer skip links like this. Normally, the skip links are hidden from view; but it's really cool to have the skip link become visible when the link receives focus, so that sighted keyboard users know that it's there.

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2011
    Location
    The land of nod
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers for that skiplink advice Ralph :-)

    Out of interest because I cannot still get these accesskeys to work, I just want to run through exactly where Im supposed to be implementing the accesskey code :

    Im only actually using :

    home page = accesskey = 1
    faq page = accesskey = 5
    contact page = accesskey = 9
    access list page = accesskey = 0

    Are the above accesskeys are only placed on the desired page so they only have 1 instance of being written. So the home page accesskey is soley written in the main navigation on the homepage in the actual homepage anchor tag, and then the same goes for the faq/contact & accessibility pages, or is each accesskey instance repeated across all navigation <a> tags and all html pages in the site ?

    Sorry if I come across some what confused, its just that this is the first time Im implementing them into a website.

  4. #4
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    Typically you would repeat the access keys throughout the site navigation where appropriate - since you cannot guarantee which page the user is on at any particular time.

    So it would be silly having a single occurrence of a key (on one page only) if many pages had links to it, e.g. like the home page.

    A generic page menu: <a href="index.htm" accesskey="1">My Site's Home Page</a>

    You would preferentially want the user to be able to navigate to the home page (site-wide) from several places, by pressing the numeric key '1', etc.

  5. #5
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,214
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by benisjamin View Post
    So the home page accesskey is soley written in the main navigation on the homepage in the actual homepage anchor tag
    No, as Robert said, place the access keys on all pages, such as in the main menu. If you only have the accesskey to the home page on the home page itself, it will simply provide an easy way to navigate to the home page when you are on the home page itself. Which is completely pointless, of course. You want to be able to press an access key to navigate to the home page when you are on any other page.

  6. #6
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    The UK list bothers me because it makes navigation across pages on the site, which the user should likely already have access to in any situation with accesskeys; I prefer to assign mine to on-page navigations so they can hop between sections quickly -- which is why my accesskeys are usually assigned to my hidden .jumpto menu.

    One bit of advice -- put titles on those anchors when you make accesskeys. In blazer and Opera when you pull up the accesskeys menu if you don't have title on them it will show the URL instead of the text inside the anchor. (go into Opera for desktop, hit shift-esc to see the accesskeys menu.).

  7. #7
    SitePoint Zealot
    Join Date
    Feb 2011
    Location
    The land of nod
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers to Robert and Ralph for great advice, and to deathshadow yet again for that handy tip with opera. I can see what you mean ref "shift + esc" with no title tags, its ugly! Now amended and looking all pretty again in Opera. :-)

    Thanks

    RALPH: Its good that those access keys work for you, but they are still not working on my laptop. Can anybody else shed any light to the reason why Im unable to gain access to the accesskeys but Ralph is....... ?

    Im using Windows (7 if that makes any difference which it wont) and have tested across all the latest browsers so: FF/IE/Opera/Chrome and Safari, and none of my keyboard pairings work, those being :

    alt + num
    ctrl + num
    ctrl + shift + num
    alt + shift + num

  8. #8
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,214
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    What does "num" stand for? Have you tried pressing alt and 5 at the same time, for example?

  9. #9
    Non-Member bronze trophy
    Join Date
    Nov 2009
    Location
    Keene, NH
    Posts
    3,760
    Mentioned
    23 Post(s)
    Tagged
    0 Thread(s)
    To diagnose more, we'd have to see the site in question.

  10. #10
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    It looks like they've changed the access key combos awhile back: http://en.wikipedia.org/wiki/Access_...erent_browsers

  11. #11
    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 benisjamin View Post

    Im using Windows (7 if that makes any difference which it wont) and have tested across all the latest browsers so: FF/IE/Opera/Chrome and Safari, and none of my keyboard pairings work, those being :

    alt + num
    ctrl + num
    ctrl + shift + num
    alt + shift + num
    In IE, you press Alt + __, and that link gets focus. Hit enter, to go. FF you should just be able to hit alt+Shift + ___ and it goes.
    Ryan B | My Blog | Twitter

  12. #12
    SitePoint Wizard Stomme poes's Avatar
    Join Date
    Aug 2007
    Location
    Netherlands
    Posts
    10,279
    Mentioned
    51 Post(s)
    Tagged
    2 Thread(s)
    I gotta say, I prefer IE's way. It mimics what happens with links: first I focus, THEN I can either enter or move on. As it should be. Go Team IE.

    Quote Originally Posted by Crusty
    One bit of advice -- put titles on those anchors when you make accesskeys. In blazer and Opera when you pull up the accesskeys menu if you don't have title on them it will show the URL instead of the text inside the anchor. (go into Opera for desktop, hit shift-esc to see the accesskeys menu.).
    I discovered recently that if a form element is given an accesskey (say the username input of a login form), Opera will use the value of the input the same as it would use a title on an anchor.
    Though I also saw a checkbox with one and it had a value="1" so Opera called it "(null)". That checkbox should not have an accesskey in the first place.


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
  •