我想创建悬停效果与回调函数。看起来效果只能在回调函数上触发,而不能在init悬停中触发。我想知道这里有人能帮助我。非常感谢。Jquery回调函数问题
$("img").live("hover", function() {
// hover in
$(this).css("z-index", 1);
$(this).animate({
height: "35%",
width: "35%",
left: "-=50",
top: "-=50"
}, "fast");
}, function() { //only the following codes will be triggered.
// hover out
$(this).css("z-index", 0);
$(this).animate({
height: "15%",
width: "15%",
left: "+=50",
top: "+=50"
}, "fast");
});
的IMG通过Ajax调用产生的,不知道这是否是相关
<div id='image_layout'>
<img src='a.jpg' />
<img src='b.jpg' />
<img src='c.jpg' />
</div>
只有['.hover()'](http://api.jquery.com/hover /)速记支持2个这样的功能。 '活着'不会那样工作。 – 2012-08-02 17:05:04