1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

JQuery Hotkeys Tutorial

Discussion in 'Gimp Tips & Tutorials' started by mikethedj4, Jun 28, 2011.

  1. mikethedj4

    mikethedj4 Member

    Joined:
    Nov 13, 2010
    Messages:
    594
    Likes Received:
    1
    Trophy Points:
    16
    Gender:
    Male
    Occupation:
    Web UI/UX Designer, Enginner, and Personal Trainer
    Location:
    Rockford, IL
    Home Page:
    [youtube]h7-Uh7fWn9A[/youtube]

    Click here to view the demo. (Note: The hotkey is CTRL+Q)

    Before we get started. Make sure you have JQuery downloaded, and then download JQuery Hotkeys.

    Now add in the following files like so...
    Code:
    <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:
    $(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;.
     

    Attached Files:

Share This Page