Advertisement
Guest User

Countdown

a guest
Aug 18th, 2013
83
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>TITULO DA PAGINA</title>
  6.  
  7. <script type="text/javascript">
  8. window.onload=function() {
  9. function countdown() {
  10. if ( typeof countdown.counter == 'undefined' ) {
  11.     countdown.counter = 5; // inicio
  12.     }
  13. if(countdown.counter > 0) {
  14.     document.getElementById('count').innerHTML = countdown.counter--;
  15.     setTimeout(countdown, 1000);
  16.     }
  17. else {
  18.     location.href = 'http://XPTO.PT/';
  19.     }
  20. }
  21. countdown();
  22. };
  23. </script>
  24.  
  25. </head>
  26. <body>
  27. <h2>Vai ser redireccionado em <span id="count"></span> segundos</h2>.
  28. </body>
  29. </html>
Advertisement
RAW Paste Data Copied
Advertisement