SitePoint Sponsor |
|
User Tag List
Results 1 to 6 of 6
-
Jun 3, 2009, 03:28 #1
- 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>
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">
-
Jun 3, 2009, 03:38 #2
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-
Jun 3, 2009, 04:13 #3
- 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.
-
Jun 3, 2009, 04:56 #4
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- 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
-
Jun 3, 2009, 05:37 #5
- 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?
-
Jun 3, 2009, 05:53 #6
- Join Date
- Nov 2004
- Location
- Ankh-Morpork
- Posts
- 12,158
- 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