You don't need to edit the navigate function, rather you can use it. Once you declare like so:
Code:
<script type="text/javascript">
var firstreel=new reelslideshow({
wrapperid: "myreel", //ID of blank DIV on page to house Slideshow
dimensions: [300, 200], //width/height of gallery in pixels. Should reflect dimensions of largest image
imagearray: [
["http://i26.tinypic.com/11l7ls0.jpg"], //["image_path", "optional_link", "optional_target"]
["http://i29.tinypic.com/xp3hns.jpg", "http://en.wikipedia.org/wiki/Cave", "_new"],
["http://i30.tinypic.com/531q3n.jpg"],
["http://i31.tinypic.com/119w28m.jpg"] //<--no trailing comma after very last image element!
],
displaymode: {type:'auto', pause:2000, cycles:2, pauseonmouseover:true},
orientation: "h", //Valid values: "h" or "v"
persist: true, //remember last viewed slide and recall within same session?
slideduration: 300 //transition duration (milliseconds)
})
</script>
the var firstreel now holds the instance. So you can do:
Code:
jQuery(document).keydown(function(e){
if (e.keyCode == 37) {
firstreel.navigate('back')
} if (e.keyCode == 39) {
firstreel.navigate('forth');
}
});
I'd advise against using the up and down keys (38 and 40) as they control the vertical scrolling of the page. Even the left and right keys are suspect as, if there's a horizontal scrollbar, they control it. So you might want to use keys like n for next and p for previous or in the case of a vertical reel u for up and d for down.
You can override the default actions of the arrow or other keys. But if you do it will probably inconvenience some users, mildly or severely. There are those who would say don't mess with the keyboard at all because some users might need it.
Bookmarks