Between keypress/keydown/trigger/event, i’m not sure which is the best for what i want to do.
I want a function that when i hold a key down, then click on an element, a css effect will be added to it.
For example:
I hold spacebar, then click an img element. It gains a class that moves it some distance, and gives it a border.
This will do it for alt click,
You can also do it using the control key
ctrlKeyor shift keyshiftKey.Spacebar have it’s special uses and it should not be used for this purpose.
Check working example at http://jsfiddle.net/8ZzJM/