Keyboard navigation?

Permalink Browser Info Environment
Hi,
would it be possible to enable keyboard navigation?

Type: Discussion
Status: Resolved
okapi
View Replies:
shahroq replied on at Permalink Reply
shahroq
Hi,
There is no option for navigating with the keyboard in Add-on, yet you can easily add the required code to your js file. Check this topic will help you:
https://stackoverflow.com/questions/28856300/owl-carousel-keyboard-n...
okapi replied on at Permalink Reply
okapi
Thanks so much for that information!
okapi replied on at Permalink Reply
okapi
Just to help others, who are interested in enabling keyboard navigation, this is what i did:

I created a custom block template, consisting of a copy of view.php and a file view.js with the following code:

jQuery(document.documentElement).keyup(function (event) {    
    var owl = jQuery(".owl-carousel");
    // handle cursor keys
    if (event.keyCode == 37) {
       // go left
       owl.trigger('owl.prev');
    } else if (event.keyCode == 39) {
       // go right
       owl.trigger('owl.next');
    }
});

Now keyboard navigation works as desired.
shahroq replied on at Permalink Reply
shahroq
Thank you Michael for sharing.
Cheers,

concrete5 Environment Information

Concrete5 8.4.0

Browser User-Agent String

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.