Personal tools
You are here: Home ブログ hamabe Stuff jQuery - Escape from meeting attendances
« December 2010 »
Su Mo Tu We Th Fr Sa
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Recent comments
Re:コマンド入力を実装しよう inoue 2007-08-14
 
Document Actions

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>

Copyright(C) 2001 - 2006 Ariel Networks, Inc. All rights reserved.