Canbeara wrote:
Quote:
Is there any way I could tap the R/L arrow keys with javascript
to fire an onclick event for the PREV/NEXT links that would make it easier
for keyboard enthusiasts to view the photos? |
You could use the onkeydown-event to determine when you hit the Left or
Right-key:
<script type="text/javascript">
document.onkeydown = function(e) {
// Right = 39
// Left = 37
e = (typeof e == "undefined") ? event : e;
b = (typeof e.which == "number") ? e.which : e.keyCode;
if (b == 39) {location.href = document.getElementById("next").href}
else if (b == 37) {location.href =
document.getElementById("prev").href}
}
</script>
</head>
<body>
<a href="prev.html" id="prev">Prev</a> - <a href="next.html"
id="next">Next</a>
You might want to change location.href = document.getEl.... Instead you
could call a function which you use in you gallery or whatever. This is
only an example and I hope you can find out how to implement it yourself.
Skovenborg