I am trying to make a menu in javascript/JQuery (css is also an option) that allows me to make it do things like show a particular drop down menu, activate a button in the menu and mimic mouseover effects without the mouse actually doing any of these things.
The reason for this is that I am making an interface that uses a function similar to let me google that for you, meaning an image of a mouse moving on the screen “showing” you where to find things in the menu. Therefore I need to be able to code in things to make a particular menu button pretend to have mouseover or having been clicked.
So basicly, how do I make a menu with unique identifiers for each button that can be called for desired effects?
If you make all of your event handlers stand alone functions you can call them manually as well. For example, instead of registering an anonymous click handler like so:
You would have:
Alternatively, if you are using jQuery, you can just call
$('#myelement').click()somewhere else in your code, and it will call whatever onclick handlers are attached to the element, the same as if someone had physically clicked on it.