jQuery - konwertuj .live () na .on ()
Jak mogę połączyć ten stary kod jQuery z wersją 1.7.on()
?
v1.3.live()
:
$('#results tbody tr').live({
mouseenter:
function () { $(this).find('.popup').show(); },
mouseleave:
function () { $(this).find('.popup').hide(); }
});
v1.7.on()
:
$('#results tbody').on('mouseenter', 'tr', function () {
$(this).find('.popup').show();
});
$('#results tbody').on('mouseleave', 'tr', function () {
$(this).find('.popup').hide();
});
Chcę przekazać obie procedury obsługi zdarzeń do jednego.on()
zadzwoń, ale zachowaj genialną delegację.on()
pozwala mi to zrobić.
Dziękuję Ci!