Results 1 to 3 of 3

Thread: Step Carousel: Keyboard navigation

  1. #1
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Step Carousel: Keyboard navigation

    1) Script Title: Step Carousel Viewer v1.9

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...epcarousel.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:

    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
            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);
    	}
    });
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    artrtrkli (01-18-2012)

  4. #3
    Join Date
    Jan 2012
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you John

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •