Question

I am making a little game with jQuery, and I wondered if it is possible to fire an event on hover and/or mouseenter when pressing Ctrl?

Était-ce utile?

La solution

bind mouseenter and keypress event for element on which you want things to work out.

$( "#id_of_element" ).bind('mouseenter keypress', function(event) {
if (event.ctrlKey)//check if cntrl key is pressed
{
//your code here
}
});
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top