One approach:
$('a').on('click mouseenter mouseleave dblclick', function (e) {
e.preventDefault();
}).on({
click: function () {
console.log("This is a click event");
},
mouseenter: function () {
console.log("This is a mouseenter event");
},
mouseleave: function () {
console.log("This is a mouseleave event");
},
dblclick: function () {
console.log("This is a double click event");
}
});
JS Fiddle demo.
Though this works, it does feel rather verbose and, it would, probably, make sense to try and handle all the functionality in one common event-handler, perhaps triggering/calling different functions based on a switch statement, for example:
$('a').on('click mouseenter mouseleave dblclick', function (e) {
e.preventDefault();
switch (e.type) {
case 'click':
clickFunction(e);
break;
case 'mouseenter':
mouseenterFunction(e);
break;
/* ...and so on... */
}
});
JS Fiddle demo.
Incidentally, JavaScript doesn't really distinguish between a click and a dblclick event, unless you measure the time between click events youself; so your event-handling is likely to be problematic.
$("h3 a").on("click mouseenter mouseleave dblclick", function(e){ e.preventDefault();});?