Using Keydown from jquery
HI, I want to make my website where no matter where your at if your press the control key you get a div to fade in which looks like a console or a form.
I have my website made in all php files but made one php file with this code echoed so that I can just include this php file in all the websites php files.
here is the code:
- <html>
<link rel=\"stylesheet\" type=\"text/css\" href=\"/home/main.css\"/>
<script type=\"text/javascript\" src=\"http://www.Chillenvillen.com/pngFix/jquery-1.3.2.min.js\"></script>
<script type=\"text/javascript\">
$(document).ready(function() {
$(window).keydown(function(event){
if (event.keyCode == '17') {
$('#console').fadeIn(\"slow\");}
});
});
</script>
<center>
<div id=\"console\">
<br><br><br><br><br><a>Type in the Pass Phrase: </a><form><input type=\"text\" name=\"phrase\">
</form>
</div>
</center>
</html>
This is in a php file echoed so ignore the "\ and "\ which tells php to echo it out as " "
this code dosen't work.
the id console is the div has one input or form in it. I want this to fade in the center of the page.
The problem I have is that when I hit control key nothing happens.
I include the code above to all my webpages. I used firebug and found no errors on it.
I even manually type the code into firebug and it worked when I pressed control key it would say control key pressed.
well that made a test where onced pressed it would echo out key pressed.
any ideas?