tags:

views:

31

answers:

2

I have a working jQuery page redirect. I want to fade into the page I am loading.

$(function(){
  var count = 5;
  countdown = setInterval(function(){
    $("p#redirect").html("You will be redirected in " + count + " seconds");
    if (count == 0) {
      window.location = 'http://link.com';
    }
    if(count < 0) {
        $("p#redirect").html("Please wait...");
    }
    count--;
  }, 1000);
});
+1  A: 

You can't do this with JavaScript, especially if it's another domain.

You can fade content it from that page when you get there (the destination page itself doing it), but you can't instruct the browser to do anything at a page it's going to, only that page can execute script.

This is mostly due to security reasons, e.g. redirecting you to https://myBank.com then running script, well, you see how that could quickly become a problem :)

Nick Craver
+3  A: 

I think you're looking for http://www.jansfreeware.com/articles/ie-page-transitions.html

The problem is it's SO 1999.
alt text

jessegavin
It's also only IE...
Nick Craver
Haha, +1 - don't fade pages from one to another - it's frustrating. I'd like to say "some users don't have Javascript enabled" but that is "so 1999" as well :)
Neurofluxation