Navigate Webflow Slider with Arrow Keys
Add arrow keys keyboard functionality to Webflow's native slider with this simple Javascript code. This added functionality allows users to use their keyboards to navigation through slides in a Webflow slider.
Add arrow keys keyboard functionality to Webflow's native slider with this simple Javascript code. This added functionality allows users to use their keyboards to navigation through slides in a Webflow slider.
How to add it
- Add Javascript code to custom code in Page Settings before the closing body tag
The code
Javascript
<script>
$(document).on('keyup', function(event) {
if (event.which === 37) {
$(' .w-slider-arrow-left').trigger('tap');
}
else if (event.which === 39) {
$('.w-slider-arrow-right').trigger('tap');
}
});
</script>