SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    I'm not a human
    Join Date
    Aug 2006
    Location
    India
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Are access key restricted to links only?

    Is access keys are restricted only to links/anchor tags?

    Code:
    <td accesskey="c" id=comp onmouseout=btnTimer()
     onmouseover=showLayer("company",'comp')>Company</td>
    doesn't seems to be working in firefox?

    What's the issue?

    I used the following code,

    Code:
    <td id=comp onmouseout=btnTimer() 
    onmouseover=showLayer("company",'comp')>Company</td>
    <accesskey="c" targetid="comp">
    can use use like this?
    Regards,
    Vijay
    Follow me on twitter @vijaycbe
    World Holiday Calander || My Cricket Blog

  2. #2
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kvijayhari View Post
    Is access keys are restricted only to links/anchor tags?
    No, the accesskey attribute can also be used for area elements and for form controls (button, input, label, legend and textarea).

    Quote Originally Posted by kvijayhari View Post
    I used the following code,

    Code:
    <td id=comp onmouseout=btnTimer() 
    onmouseover=showLayer("company",'comp')>Company</td>
    <accesskey="c" targetid="comp">
    can use use like this?
    No, there is no <accesskey> tag in HTML. It's an attribute.
    Birnam wood is come to Dunsinane

  3. #3
    I'm not a human
    Join Date
    Aug 2006
    Location
    India
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for your answer.


    I'll come directly to my requirement..

    I just want give access to my javascript menus, using keys

    How can i? What is the best method to do this?

    I've top links and when i move the mouse over them, a dropdown menu is listed. (now i use javascript function to do this)

    I want to give access to those elements inside this menu items also.
    Regards,
    Vijay
    Follow me on twitter @vijaycbe
    World Holiday Calander || My Cricket Blog

  4. #4
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's a menu doing in a table cell?

    A menu is normally an unordered list of links. Submenus are nested lists. Then you can add JavaScript to show the submenus dynamically. And if you use links, you can use accesskey attributes.

    Otherwise you can have a keyboard event listener in JavaScript and do things based on what the user is typing, but this can be a hassle on pages where the user is also able to type text, e.g., in a form.
    Birnam wood is come to Dunsinane

  5. #5
    I'm not a human
    Join Date
    Aug 2006
    Location
    India
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok i'll get rid of tables and use lists

    But what i exactly want is when i'm using the access key for the main menu items i need it call the javascript function to show the submenu and
    when sum menus are listed then when i use the access key again it should traverse to the page.


    How can i call the javascript function on pressing the access key instead of going directly to the page?
    Regards,
    Vijay
    Follow me on twitter @vijaycbe
    World Holiday Calander || My Cricket Blog

  6. #6
    SitePoint Author silver trophybronze trophy

    Join Date
    Nov 2004
    Location
    Ankh-Morpork
    Posts
    12,159
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In some browsers, pressing the accesskey activates the link. In IE, if I recall correctly, it only puts focus to the link and you have to hit Enter to activate it.

    To perform a JavaScript action instead of following a link, add a JavaScript onclick event handler to the link:
    Code HTML4Strict:
    <ul id="menu">
      <li>
        <a href="#" onclick="showSubmenu(); return false">Top Item</a>
        <ul>
          <li><a href="page1.html">Sub-Item 1</a></li>
          <li><a href="page2.html">Sub-Item 2</a></li>
          <li><a href="page3.html">Sub-Item 3</a></li>
        </ul>
      </li>
      ...
    </ul>
    Birnam wood is come to Dunsinane


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
  •