Code:
<!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>
<title>CHAOS SOCCER MANAGER v1.0</title>
<style type="text/css">
#scoreboard {
width:600px;background-color:blue;color:white;margin:0 auto;text-align:center;
font-size:300%;vertical-align:baseline;padding:50px 0;
}
</style>
<script type="text/javascript">
var flick,countdown=10;
function flicker(timer) {
clearTimeout(flick);
document.getElementById("scoreboard").setAttribute('style','background-color:blue;color:white;'); // sets flicker colors
flick = setTimeout(function(){ styles(); },100); // begins the flicker and sends to styles function
}
function styles() {
document.getElementById("scoreboard").setAttribute('style','background-color:white;color:blue;');
countdown--;
if (countdown>-1) flick = setTimeout(function(){ flicker(); },100); // alternative flicker color and invoke function loop
}
</script>
</head><body>
<div id="scoreboard" onmouseover="flicker('true')">
<p>GOAL</p>
</div>
</body></html>
Bookmarks