devlev1980
4/4/2018 - 3:00 PM

Fade Effect

var fadeEffect = setInterval(function () {
        if (!imageDiv.style.opacity) {
          imageDiv.style.opacity = '1';
        }
        if (imageDiv.style.opacity < '0.1') {
          clearInterval(fadeEffect);
        } else {
          imageDiv.style.opacity -= '0.1';
        }
      }, 200);