How do I get jQuery to decrease the value of $ ("# recentTrack"), replace its contents, and then extinguish it again? The current code disappears and keeps it hidden, rather than fading out again:
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);
source share