File: test-static-07.html

package info (click to toggle)
libjs-jquery-hotkeys 0.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 608 kB
  • sloc: javascript: 10,395; makefile: 25
file content (29 lines) | stat: -rw-r--r-- 891 bytes parent folder | download
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
<html>
    <head>
        <script src="jquery-1.4.2.js"></script>
        <script src="jquery.hotkeys.js"></script>
    </head>

    <body>
        <input type="button" id="bindCtrlS" value="bind ctrl+s" />
        <input type="button" id="unBindCtrlS" value="unbind ctrl+s" />
        <script>
            function bindCtrlS(){
                jQuery(document).bind('keydown', 'ctrl+s',function (evt){
                    alert("Ctrl+S");
                    return false;
                });
            }
            
            function unBindCtrlS(){
                jQuery(document).unbind('keydown', 'ctrl+s');
            }
            
            $(document).ready(function(){
                $('#bindCtrlS').bind('click', bindCtrlS);
                $('#unBindCtrlS').bind('click', unBindCtrlS);
                }
            );
            
        </script>
    </body></html>