samedi 22 décembre 2018

When redirecting to another webpage the function keeps repeating

So basically what I want to do is run an animation for 7 seconds then redirect to the actual index.html file but when I use the code below the animation finishes in 7 seconds it redirects to index.html then it keeps reloading the index.html I was thinking of using a for loop or if statement but I dont really know where to start.

thanks

$(function() {
setTimeout(function() {
$(".fly-in-text").removeClass("hidden");
});
setTimeout(function() {
$(".allblack").remove();
}, 7000);


  $(document).ready(function() {
  // Handler for .ready() called.
  window.setTimeout(function() {
  location.href = "index.html";
  }, 7000);
 });
});

What my code currently looks like

Aucun commentaire:

Enregistrer un commentaire