To connect to multiple events, you must pass a list of events separated by spaces:
$(".parent-selector").on("mouseenter.namespace mouseleave.namespace", ".selector", function() { });
Edit:
You can always get the type of event inside the callback and call other functions inside:
$(".parent-selector").on("mouseenter.namespace mouseleave.namespace", ".selector", function(e) { if (e.type == "mouseenter.namespace") { myMouseEnter(e); } else if (e.type == "mouseleave.namespace") { myMouseLeave(e); } });
It seems like this is working, I canβt confirm this because I am not on my machine. Give it a try.
rcdmk source share