Code

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.

Navigate Webflow Slider with Arrow Keys preview

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

  1. 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>

                    

Browse similar code snippets

Language

More from Corey Moen

Profile →

Related Webflow questions

All answers →

Similar code snippets

All code snippets →