Question: How to add laptop trackpad (horizontal scroll) support to this implementation? #183071
-
BodyHi everyone, I am currently using Slick Slider with a custom script to handle dynamic heights on desktop/tablet. It works well with click-and-drag navigation. However, I want to add support for laptop trackpads (and horizontal mouse wheels) so that users can swipe left/right on their trackpad to navigate the slides, rather than having to click and drag. Does anyone know how to bind the wheel or scroll event to trigger slickNext and slickPrev based on horizontal movement (deltaX), without breaking my existing dynamic height logic? Here is my current code: Guidelines
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hey @web-dev-0, you don't have to touch the dynamic height logic at all. You can just listen for the Here is an example that you can implement in practice, this should enable the trackpad swipe as well as the horizontal mouse wheel navigation without breaking anything else. Let me know if this helped, mate! |
Beta Was this translation helpful? Give feedback.
Hey @web-dev-0, you don't have to touch the dynamic height logic at all. You can just listen for the
wheelevent and react to horizontal scroll.Here is an example that you can implement
in practice, this should enable the trackpad swipe as well as the horizontal mouse wheel navigation without breaking anything else. Let me know if…