lightslider icon indicating copy to clipboard operation
lightslider copied to clipboard

disable touch on a single slide

Open ramm8313 opened this issue 8 years ago • 3 comments

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?

ramm8313 avatar Dec 09 '16 20:12 ramm8313

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 avatar Jan 05 '17 08:01 dreamweiver

@dreamweiver Can you please give a snippet how to do this for a single item?

Dakshank avatar Feb 07 '19 08:02 Dakshank

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

image

@sachinchoolur, could you close this.

dreamweiver avatar Feb 11 '19 12:02 dreamweiver