lightslider
lightslider copied to clipboard
disable touch on a single slide
Its that a way to change the enabletouch seetings to false for a single slide? let say the first on and the rest can be swiped normally?
Currently the touch event is listened over the container of all the slides & not on individual slide. so it is not possible to control touch events for individual slides from lightslider js, instead you can write your own touch event (touchStart,touchMove,touchEnd) handler for the specific slide element and stop the event from propagating up the chain .
event.stopPropagation()
read more about stopPropagation here
@dreamweiver Can you please give a snippet how to do this for a single item?
@Dakshank , you can refer to this mdn article to understand more about touch events and how to use them, https://developer.mozilla.org/en-US/docs/Web/API/Touch_events#Example
since the touch events are handled on the wrapper level, you need to write your own definition of touch events for a specific slide.
refer to the source of light slider to know how touch events are handled currently.
@sachinchoolur, could you close this.