C
Cave Johnson
Gast
Hi,
ich habe folgendes Script als Basis:
Da der .button2 bei mir via AJAX nachgeladen wird, muss ich anstelle von .hover() mit .live("hover", ...) arbeiten. Allerdings schaffe ich es damit nicht mehr beide Funktionen zusammenzufassen, sondern muss diese getrennt aufrufen (und anstelle von hover dann mit mouseenter und mouseleave:
Kann mir jemand verraten, wie ich das auch mit .live() und .hover() unter einen Hut bekomme? Ich hatte ja folgendes probiert, aber damit funktioniert die zweite Animation beim verlassen nicht mehr:
Bei dem klappt gar kein Hovern mehr:
ich habe folgendes Script als Basis:
PHP:
$('.button2 a').hover(function(){
$(this).stop().animate({'opacity' : '0'}, 500);
}, function(){$(this).stop().animate({'opacity' : '1'}, 500);
});
PHP:
$('.button2 a').live("mouseenter", function(){
$(this).stop().animate({'opacity' : '0'}, 300);
});
$('.button2 a').live("mouseleave", function(){
$(this).stop().animate({'opacity' : '1'}, 300);
});
Kann mir jemand verraten, wie ich das auch mit .live() und .hover() unter einen Hut bekomme? Ich hatte ja folgendes probiert, aber damit funktioniert die zweite Animation beim verlassen nicht mehr:
PHP:
$('.button2 a').live("hover", function(){
$(this).stop().animate({'opacity' : '0'}, 500);
}),("hover", function(){$(this).stop().animate({'opacity' : '1'}, 500);
});
PHP:
$('.button2 a').live("hover", function(){
$(this).stop().animate({'opacity' : '0'}, 300);
}, function(){$(this).stop().animate({'opacity' : '1'}, 300);
});