Skip to content

Instantly share code, notes, and snippets.

@felladrin
Created February 10, 2012 20:41
Show Gist options
  • Save felladrin/1792698 to your computer and use it in GitHub Desktop.
Save felladrin/1792698 to your computer and use it in GitHub Desktop.
Código html para uma página de redirecionamento
<!DOCTYPE html>
<html>
<head>
<title>Mudamos de endereço!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="5;url=http://google.com.br">
<style type="text/css">
a
{
color:#2098DF;
text-decoration:none;
}
body
{
font-family: Verdana, Geneva, sans-serif;
color:#666;
text-align: center;
}
</style>
</head>
<body>
<p>Nosso portal mudou de endereço!</p>
<p><a href="http://google.com.br/">www.google.com.br</a></p>
<p><span id="redirecionamento" style='border:0; color:#666; text-align: center; font-family: Arial, Helvetica, sans-serif;'></span></p>
<script>
var s = 5; contar();
function contar()
{
if (s == 0)
{
document.getElementById('redirecionamento').innerHTML = 'Redirecionando agora. Bom proveito!';
clearTimeout(contagem);
}
else if (s == 1)
{
document.getElementById('redirecionamento').innerHTML = 'Redirecionando em ' + s-- + ' segundo.';
contagem = setTimeout(contar, 1000);
}
else
{
document.getElementById('redirecionamento').innerHTML = 'Redirecionando em ' + s-- + ' segundos.';
contagem = setTimeout(contar, 1000);
}
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment