標題說明了這一切,但這不起作用, 懸停函數可以工作,不管是否正文。jQuery .on()元素,如果父元素沒有類
$("#content").on("click", "a.zoom", function(e) {
$("body").addClass("zoomed");
}
$("#content").on("hover", "body:not(.zoomed) a.animation", function(e) {
//stuff
}
我也嘗試了其他方式,但我不明白這一點。
$("body:not(.zoomed) #content").on("hover", "a.animation", function(e) {
//stuff
}
這是在這裏工作:http://jsfiddle.net/richardneililagan/Ng6hW/2/ –