通过Ajax更新内容时,Jquery停止
我有: 我试图在通过Ajax刷新一组新图像后保持jquery悬停效果。当前,一旦Ajax刷新,jquery将被终止 我想我需要.delegate()或.live(),但似乎两者都无法工作。仍在学习jquery。尝试以下方法:通过Ajax更新内容时,Jquery停止,ajax,jquery,Ajax,Jquery,我有: 我试图在通过Ajax刷新一组新图像后保持jquery悬停效果。当前,一旦Ajax刷新,jquery将被终止 我想我需要.delegate()或.live(),但似乎两者都无法工作。仍在学习jquery。尝试以下方法: $('.image.txt_over').hover(function(){ $(".screen", this).stop().animate({top:'165px'},{queue:false,duration:300}); $(this).fadeT
$('.image.txt_over').hover(function(){
$(".screen", this).stop().animate({top:'165px'},{queue:false,duration:300});
$(this).fadeTo("slow", 1);
}, function() {
$(".screen", this).stop().animate({top:'226px'},{queue:false,duration:460});
});
完美的这就解决了。谢谢
$('body').delegate('.image.txt_over', 'mouseover mouseout', function(event) {
if (event.type == 'mouseover') {
$(".screen", this).stop().animate({top:'165px'},{queue:false,duration:300});
$(this).fadeTo("slow", 1);
} else {
$(".screen", this).stop().animate({top:'226px'},{queue:false,duration:460});
}
});