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);