Skip to content

Instantly share code, notes, and snippets.

@tzuryby
Created December 7, 2009 11:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzuryby/250781 to your computer and use it in GitHub Desktop.
Save tzuryby/250781 to your computer and use it in GitHub Desktop.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jquery-Test</title>
</head>
<body>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://js-hotkeys.googlecode.com/files/jquery.hotkeys-0.7.9.min.js"></script>
<script>
//~ function goNext(){
//~ window.location.href = $("#BtnNext").attr("href");
//~ return true;
//~ }
//~ function goPrev(){
//~ window.location.href = $("#BtnPrev").attr("href");
//~ return true;
//~ }
function init() {
$("a").click(function(){
window.location.href = $(this).attr("href");
return true;
});
//~ $("#BtnPrev").click(goPrev);
//~ $("#BtnNext").click(goNext);
$(document).bind('keydown', 'Ctrl+left',
function (evt) {
$('#BtnPrev').click();
});
$(document).bind('keydown', 'Ctrl+right',
function(e) {
$('#BtnNext').click();
});
}
$(document).ready(init);
</script>
<p>
<a href="http://www.ubka.uni-karlsruhe.de/?from=prev" id="BtnPrev">BtnPrev</a>
<br>
Press Ctrl + Pfeil-nach-links to use BtnPrev
<br>
<a href="http://www.ubka.uni-karlsruhe.de/?from=next" id="BtnNext">BtnNext</a>
<br>
Press Ctrl + Pfeil-nach-rechts to use BtnNext
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment