setInterval repeats again and again after interval time
setTimeout only waits once for interval time and does not repeat
$(window).load(function () {
setInterval(function () {
var zoom = document.getElementById("zoom");
var fade = document.getElementById("divfade1");
$("#divfade1").hide();
TweenMax.to(zoom, 1, {
left: "950px", ease: Power4.easeInOut, onComplete: function () {
$("#divfade1").fadeIn(100, function () {
TweenMax.to(zoom, 1, {
css: {
left: "0px", autoAlpha: 0
}, ease: Power4.easeInOut, onComplete: function () {
$("#divfade1").fadeOut(100)
}
});
});
}
});
}, 500);
});