PDA

View Full Version : Step Carousel: Keyboard navigation



artrtrkli
01-18-2012, 02:26 PM
1) Script Title: Step Carousel Viewer v1.9

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/stepcarousel.htm

3) Describe problem: I'm trying to work out how keyboard navigation can be handled with prev and next buttons to scroll through the stack.

Code:


<script type="text/javascript">

stepcarousel.setup({
galleryid: 'gallery',
beltclass: 'belt',
panelclass: 'image',
panelbehavior: {speed:500, wraparound:true, wrapbehavior:'slide', persist:false},
defaultbuttons: false,
statusvars: ['statusA', 'statusB', 'statusC'],
contenttype: ['inline']
})



$('.stepcarousel').keydown(function(e){ if (e.keyCode == 37)$('stepcarousel').setup('statusA');else if (e.keyCode == 39)$('stepcarousel').setup('statusC'); });;

</script>

Thank you

jscheuer1
01-18-2012, 04:27 PM
stepcarousel.setup({
galleryid: 'gallery',
beltclass: 'belt',
panelclass: 'image',
panelbehavior: {speed:500, wraparound:true, wrapbehavior:'slide', persist:false},
defaultbuttons: false,
statusvars: ['statusA', 'statusB', 'statusC'],
contenttype: ['inline']
});

jQuery(document).keydown(function(e){
var actionNumber = e.keyCode - 38;
if(Math.abs(actionNumber) === 1){
stepcarousel.stepBy('gallery', actionNumber);
}
});

artrtrkli
01-18-2012, 06:42 PM
Thank you John