Jump to content

Access key to hover ?!?


wright67uk

Recommended Posts

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! )  ?

Link to comment
https://forums.phpfreaks.com/topic/247152-access-key-to-hover/
Share on other sites

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/

Link to comment
https://forums.phpfreaks.com/topic/247152-access-key-to-hover/#findComment-1269367
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.