I find the presentation/style of the following jQuery .on() preferable (ie handing over a plain object that can contain multiple events/callbacks):
$( selector ).on( { mouseover:function(event) {
console.log('mouseover');
},
mouseout:function(event) {
console.log('mouseout');
}
});
However I would like both mouseover and focus to reference the same function so I tried the following:
$( selector ).on( { 'mouseover, focus':function(event) {
console.log('over/focus');
},
'mouseout, focusout':function(event) {
console.log('mouseout/focusout');
}
});
The results were focus and focusout worked but not mouseover/mouseout.
Could anyone guide me on how to do this inside a plain object, ie with this structure/style of using .on()
Many thanks in advance