Team:Uppsala/Templates/navigation template

From 2014.igem.org

(Difference between revisions)
Line 81: Line 81:
</div>
</div>
<div id="imagediv"><div>
<div id="imagediv"><div>
 +
 +
<script>
 +
 +
var keys = {};
 +
 +
$(document).keydown(function (e) {
 +
$('#secret').remove();
 +
    keys[e.which] = true;
 +
    printKeys();
 +
});
 +
 +
function printKeys() {
 +
    var html = '';
 +
var test = 0;
 +
    for (var i in keys) {
 +
if( i == 69 || i == 71 || i == 73 || i ==77)
 +
test++
 +
else
 +
test--
 +
    }
 +
if (test==4)
 +
{
 +
var img = $('<img />',{ id: 'secret', src: 'https://fbcdn-sphotos-c-a.akamaihd.net/hphotos-ak-xfa1/t1.0-9/p417x417/10389042_690342884367707_4283038089202479847_n.jpg', alt:'MyAlt'}).appendTo($('#imagediv'));
 +
test=0;
 +
keys = {};
 +
img.fadeOut( 2000 );
 +
}
 +
else if(test < 0)
 +
keys = {};
 +
}
 +
</script>
<div class="clear">
<div class="clear">
</div>   
</div>   
</html>
</html>

Revision as of 19:15, 5 August 2014