[Tut] Hotkeys in JQuery

3 posts Page 1 of 1
Contributors
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

[Tut] Hotkeys in JQuery
mikethedj4
Before we get started. Make sure you have JQuery downloaded, and then download JQuery Hotkeys.

Now add in the following files like so...
Code: Select all
<html>
<head>
<title>JQuery Hotkeys</title>
<script src="jquery-1.6.1.js"></script>
<script src="jquery.hotkeys.js"></script>
</head>
<body>
	
</body>
</html>
Now it's super easy to make a hotkey.
For example look at my code below.
Code: Select all
$(document).bind('keydown', 'ctrl+q', function() {
	alert('You found the hotkey!');
});
What this code does is, when you press CTRL+Q an alertbox will popup saying "You found the hotkey!".

I told you it was easy cooll;.
You do not have the required permissions to view the files attached to this post.
User avatar
Livengood
Serious Programmer
Serious Programmer
Posts: 444
Joined: Tue Feb 16, 2010 6:24 am

Re: [Tut] Hotkeys in JQuery
Livengood
Thanks for the share :), this will come handy :D
Image
User avatar
mikethedj4
VIP - Site Partner
VIP - Site Partner
Posts: 2592
Joined: Thu Mar 25, 2010 4:36 am

Re: [Tut] Hotkeys in JQuery
mikethedj4
You're very welcome
3 posts Page 1 of 1
Return to “Tutorials”