<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.2.0/build/cssreset/reset-min.css" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.2.0/build/cssbase/base-min.css" />
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/3.2.0/build/cssfonts/fonts-min.css" />
<title>
Counter Demo
</title>
</head>
<body>
<span id="counter">
60
</span>
<script type="text/javascript" charset="utf-8">
//<![CDATA[
var counter = {};
counter.tick = function(){
var count = parseInt($('#counter').html());
if(0 < count){
$('#counter').html(--count);
return;
}
window.location = 'http://www.google.co.uk/';
};
$(document).ready(function(){
setInterval(counter.tick, 1000);
});
//]]>
</script>
</body>
</html>
Bookmarks