How do I go about combining this old jQuery code into the v1.7 .on()
?
v1.3 .live()
:
$(\'#results tbody tr\').live({
I just want to pass both event handlers in one object, like I do in the first example.
In this case you could attach the two events together, then differentiate them in the handler itself, like this:
$('#results tbody').on('mouseenter mouseleave', 'tr', function (e) {
if (e.type == "mouseenter") {
$(this).find('.popup').show();
}
else {
$(this).find('.popup').hide();
}
});