【发布时间】:2012-07-19 11:05:59
【问题描述】:
我想知道如何用 jQuery on() 重写以下监听器
$('.box').live({
mouseenter:
function() {
$(this).children('.menu').stop(true, true).fadeIn(fadeIn);
},
mouseleave:
function() {
$(this).children('.menu').stop(true, true).fadeOut(fadeOut);
}
});
有什么想法吗?
【问题讨论】:
-
参见stackoverflow.com/questions/8021436/… 和文档api.jquery.com/live、api.jquery.com/on。您将在此处找到有关如何将
.live转换为.on的信息。
标签: javascript events deprecated jquery