<!doctype html>
<head>
<title>CTRL + S</title>
<script src="./jquery-2.1.1.js"></script>
</head>
<body>
<script>
$(window).keypress(function(event) {
if (!(event.which == 115 && event.ctrlKey) && !(event.which == 19)) return true;
alert("Ctrl-S pressed");
event.preventDefault();
return false;
});
</script>
</body>
</html>
Zdroj:
http://stackoverflow.com/questions/93695/best-cross-browser-method-to-capture-ctrls-with-jquery
Žádné komentáře:
Okomentovat