You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a draggable slider of images. These images have Lity implemented. I'm unable to drag the images to navigate through the slides because Lity triggers every time I release the click after draggin images. I would like to know if there is a way to avoid that.
I need Lity to trigger only when I click the image, but not when I drag it.
I also posted the question at this link (StackOverflow) with a bit more context.
Thank you!
The text was updated successfully, but these errors were encountered:
Since I can't use the typical click event because it will also trigger when dragging, I did it with the help of events from the library I use to create the slider.
This library is called Flickity, and I realized it has its own event called staticClick that responds to a static click, meaning without movement.
So, I attach to the staticClick event and manually trigger Lity at that moment, resulting in the JavaScript code like this:
Since everything is in a foreach loop that can create many sliders, I ensure that Lity is only launched on sliders that have the data-high-res attribute.
I hope this helps people who are using Lity and Flickity together and have encountered the same issue.
But anyway, I believe it would be good for Lity to have this implemented already, so we wouldn't have to depend on other libraries to do it.
I have a draggable slider of images. These images have Lity implemented. I'm unable to drag the images to navigate through the slides because Lity triggers every time I release the click after draggin images. I would like to know if there is a way to avoid that.
I need Lity to trigger only when I click the image, but not when I drag it.
I also posted the question at this link (StackOverflow) with a bit more context.
Thank you!
The text was updated successfully, but these errors were encountered: