I'm trying to make a dynamic javascript menu (contained in a div) appear at a visitor's mouse coordinates when they press ctrl+m
on their keyboard (m signifying menu, and ctrl+m
not being bound in most browsers as far as I'm aware). This way, wherever they are on my site and wherever their mouse is, they can pull up the menu by just pressing that combination and return to wherever they wish to go. At the same time, having the menu not shown until they press the key allows me to control the design experience completely without having to worry about a nav menu.
I've pulled together two different pieces of code I found on here in an attempt to do this myself, but I'm running into an unexpected issue.
- I'm not sure how to denote the
ctrl+m
key combination in the event handler. - I'm getting a couple of errors on the code checker that I'm not sure how to fix myself.
- I'm not sure how to make it so that the menu appears on ctrl+m, and stays there until
ctrl+m
is pressed again (a toggle switch).
I'm still learning how Javascript works.
Here's the link to the progress I've made so far: http://jsfiddle.net/nrz4Z/