この古い jQuery コードを v1.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();
});
両方のイベント ハンドラーを 1 つの呼び出しに渡したいのです.on()が、華麗なイベント デリゲーションを維持する.on()ことができます。
ありがとうございました!