Need to combine next and previous buttons with keys 37 and 39...

Need to combine next and previous buttons with keys 37 and 39...

Hello,


I've been in zounds of forums and I just can't get it working.I currently have fully functioning left and right navigation buttons on my slideshow - how can I add keypress functions to them so that left and right arrow keys would do the same action?It should be simple,but I just can't get it working.


My current small script with only the functioning buttons:

  1. $( document ).ready( function () {

    $( "#slideshow" ).css( "overflow" , "hidden" );

    $( "ul#slides" ).cycle({

    fx: 'fade' ,

    pause: 6 ,

    prev: '#prev' ,

    next: '#next'

    }).cycle( "pause" );

    $( "#slideshow" ).hover( function () {

    $( "ul#nav" ).fadeIn();

    },

    function () {

    $( "ul#nav" ).fadeOut();

    });

    });

I would like to embedd the left and right arrow keys to do the same action that the previous and next buttons do.


With best regards and thanks in advance,

P6tu