You will need to clear the timer too
var timer;
function fadeInOut() {
$('#stars').fadeIn(800, function () {
$('#stars').fadeOut(800, function () {
$('#stars').fadeIn(800, function () {
timer = setTimeout(fadeInOut, 500);
});
});
});
timer = setTimeout(fadeInOut, 12500);
}
function replayAnim() {
clearTimeout(timer)
$('#stars').clearQueue().stop(true);
animStart();
}