Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to differentiate a drag from a click? #382

Open
pixelwatt opened this issue Oct 19, 2020 · 1 comment
Open

Is there a way to differentiate a drag from a click? #382

pixelwatt opened this issue Oct 19, 2020 · 1 comment

Comments

@pixelwatt
Copy link

Currently working on a project with tiny-slider being used to highlight a client's projects. Dragging is enabled on the slider so that slides can be navigated through by mouse drags. Only problem is that each draggable element is also a link, so upon completing the drag, the link-wrapped item that was initially clicked on for the drag is triggered. Any way to differentiate between clicks and drags on links?

@albertomoreiraluiz
Copy link

albertomoreiraluiz commented Feb 4, 2023

I know the answer is way overdue, however it might be of help to the next ones.
You can try using the blacklist, that way the smoothstate will ignore that anchors.
Something similar happened to me with my context menus, that isn't a valid link, then i add it to a blacklist on the smoothstate options.

$(function () {` 
     'use strict';
     var options = {
         prefetch: true,
         cacheLength: 10,
         blacklist: 'a[href="#"]',
         onStart: { }

[...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants