1

So I am using the Views Slideshow (7.x-3.9) module in conjunction with the Views Slideshow: Swiper JS (7.x-4.0) under Drupal 7.61 and it’s working great for my needs. But have run into an issue. The version of the Swiper JS library I have installed is 4.4.6.

While the “Format > Slideshow > Settings” clearly has an option that you need to check a checkbox to enable keyboard navigation, and I have that option unchecked, I can assure you that keyboard navigation is clearly enabled.

Looking at this issue request on the Drupal page for Views Slideshow: Swiper JS shows a similar issue where the Drupal module settings seem to not be respected by Swipe JS when loaded, but the “solution” (kludge?) of downgrading to a 3.x.x version (such as 3.4.2) doesn’t work for me. Beyond not wanting to be behind the curve in patches and development on Swiper JS, when I attempted to swap my 4.4.6 version to 3.4.2 made the slideshow go a bit haywire.

So what can practically and simply be done to disable the keyboard functionality of Swiper JS under Drupal?

Screenshot of the keyboard navigation checkbox.

1 Answer 1

1

Okay, so I solved this. It’s clear to me that the Views Slideshow: Swiper JS is somehow not passing all the config options it claims to handle to the final Swiper JS instance that gets loaded on the page.

So my solution that—works directly in the view—is to go to the Swiper JS settings “Format > Slideshow > Settings” scroll down and select “Events” and then add the following to the swiper.on('init', function() {} event:

this.params.keyboard.enabled = false;

Apply the settings, save the view and… et voilà! It works and cleanly disable keyboard navigation.

Screenshot of the <code>this.params.keyboard.enabled = false;</code> set in the 'init' event.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.