jQuery가 $ ("# recentTrack")을 페이드 아웃하고 내용을 바꾼 다음 다시 페이드 인하는 방법은 무엇입니까? 현재 코드를 페이드 아웃 오히려 그것을 다시 페이드보다 숨겨 유지 : 완료하면 이벤트 대기jQuery 페이드 인 및 아웃
$("#recentTrack").fadeOut('slow', function(){
$(this).html(x).fadeIn("slow");
});
이 방법 : 그냥으로 $("#recentTrack").fadeOut('slow').html(x).fadeIn('slow)';
을
변경
setInterval(
function()
{
$.getJSON('cache/lastfmCache.json', function(data){
var x = data.recenttracks.track[0].artist["#text"];
var y = $("#recentTrack").html();
if(x != y) {
$("#recentTrack").fadeOut('slow').html(x).fadeIn('slow)';
}
$.get('update.php');
});
}, 15000);
fadeIn ('slow)'에서 오류가 있음을 알고 있습니까? ? 그것은 fadeIn ('slow')이어야합니다; – AJJ
'$ ("recentTrack") .fadeOut ('slow') .html (x) .fadeIn ('slow)'; – naiquevin