jQuery - Escape from meeting attendances
Click here to get the file
Size
2.0 kB
-
File type
text/html
File contents
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="content-style-type" content="text/css">
<meta http-equiv="content-script-type" content="text/javascript">
<title>jQuery - Escape from meeting attendances</title>
<script type="text/javascript" charset="utf-8" src="jquery.js"></script>
</head>
<body></body>
<script type="text/javascript">
<!--
jQuery.extend({
cache_timers : [],
setInterval : function(func, ms) { jQuery.cache_timers.push(setInterval(func, ms)) },
clearInterval: function() { jQuery.each(jQuery.cache_timers, function(i,o){ clearInterval(o) }) }
});
$(function() {
$(document.body).css({ overflow:'hidden', backgroundColor:'#eef' }).html('<img src="meeting.png" />');
$('<div>START!!</div>').click(function(evt) {
$(evt.target).fadeOut();
$(document).one('mouseover', function(evt) {
var x = evt.pageX, y = evt.pageY, z = 0;
$(document).mousemove(function(evt) { x = evt.pageX; y = evt.pageY; z++; })
.one('mouseout', function() {
$(document.body).css({ backgroundColor:'red' });
jQuery.clearInterval();
alert('*** GAME OVER ***\n[ Level:' + $('body img').length + ' / Score:' + z + ' ]');
});
var element = $('<img />').attr({ src:'obscure.png' }).css({ position:'absolute', left:15, top:15 });
jQuery.setInterval(function(){
var clone = $(element).clone().appendTo(document.body);
jQuery.setInterval(function(){ clone.animate({ left:x-7, top:y-7 },'slow') }, (300+Math.random()*400));
}, 4000);
});
})
.css({ position:'absolute', left:50, top:50, border:'3px double #669', backgroundColor:'#fff', cursor:'pointer' })
.appendTo(document.body);
})
//-->
</script>
</html>