wright67uk Posted September 14, 2011 Share Posted September 14, 2011 I would like to use an access key to simulate a mouse hover is this possible? How is this done? www.1pw.co.uk/accessmenu I would like the menu in the link above to show by pressing ALT+M and then hideaway by pressing ALT+E. <style type="text/css"> #A1{background:url(1.jpg) no-repeat;} #image li a{width:30px; height:320px;display:block;float:left;} #image li a:hover{width:450px; } </style> </head> <body> <ul id="image"><li><a id="A1" href="#"></a></li></ul> </body> PS anyone who followed my link.. whats with the black dot ( its not in my image! ) ? Quote Link to comment https://forums.phpfreaks.com/topic/247152-access-key-to-hover/ Share on other sites More sharing options...
gizmola Posted September 14, 2011 Share Posted September 14, 2011 The dot is because you are using a ul, and you have a li in it, but you have not suppressed the default list style which you can do by styling the li items with: list-style: none; As for you key handling, you can attach an event handler to the document, and thanks to event bubbling, keypress events will bubble up to it. JQuery has a .keypress() method as an example, with some information about how it facilitates determing which key was pressed here: http://api.jquery.com/keypress/ Quote Link to comment https://forums.phpfreaks.com/topic/247152-access-key-to-hover/#findComment-1269367 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.