I want to add the ability for visitors to navigate between photo pages using their left and right arrow keys with cross-browser compatibility.
My existing HTML already has Back and Next links. What do I need to do to get the left key to trigger <%=previousLink%> and right key to trigger the <%=nextLink%>?
<div class="full-size-image-nav">
<%if previousNumber <> 0 then%>
<div class="previous">
<p><a href="<%=previousLink%>">Back</a></p>
</div>
<%end if%>
<%if nextNumber <> 0 then%>
<div class="next">
<p><a href="<%=nextLink%>">Next</a></p>
</div>
<%end if%>
</div>
I have seen jQuery Event Keypress: Which key was pressed?, but don't know how to adapt that to my code. Thank you.