I am trying to create a function that after some time spending on a specific page, without any action of user, it will redirect him into another page, but with a fade out effect. Everything works good, except that the current page doesn't fade out, just simply goes to the new page. here is my code:
setTimeout(function(){
$('body').fadeOut('slow');
window.location.href = "index.html";
}, 6000);