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

Request: add mouse dragging for desktop users #214

Closed
matthewbuchanan opened this issue Jul 2, 2012 · 20 comments
Closed

Request: add mouse dragging for desktop users #214

matthewbuchanan opened this issue Jul 2, 2012 · 20 comments

Comments

@matthewbuchanan
Copy link

@matthewbuchanan matthewbuchanan commented Jul 2, 2012

I’ve looked at a number of sliders recently, and I really like the ones which include mouse dragging as a method of desktop navigation. Is it possible to add this to FlexSlider (would work well with its responsive features)?

@zabatonni
Copy link

@zabatonni zabatonni commented Aug 18, 2012

i would appreciate this feature as well

@akobashikawa
Copy link

@akobashikawa akobashikawa commented Sep 24, 2012

I implemented this feature in this way:

  • Use jquery.event.drag (http://threedubmedia.com/code/event/drag/)

  • In jquery.flexslider.js, copy mousewheel support block as base for drag support:

    ...
    // MOUSEWHEEL:
    if (vars.mousewheel) {
    slider.bind('mousewheel', function(event, delta, deltaX, deltaY) {
    event.preventDefault();
    var target = (delta < 0) ? slider.getTarget('next') : slider.getTarget('prev');
    slider.flexAnimate(target, vars.pauseOnAction);
    });
    }
    // DRAG:
    if (vars.drag) {
    slider.bind('drag', function(event, delta) {
    event.preventDefault();
    var target = (delta.deltaX < 0) ? slider.getTarget('next') : slider.getTarget('prev');
    slider.flexAnimate(target, vars.pauseOnAction);
    });
    }
    ...

  • Also add 'drag' in flexslider defaults:
    ...
    $.flexslider.defaults = {
    ...
    mousewheel: false,
    drag: false,
    ...

  • Then, in your script use 'drag: true' if you want:

    $('.flexslider').flexslider({
    animation: 'slide',
    slideshow: false,
    drag: true
    });

@mattyza
Copy link
Member

@mattyza mattyza commented Jun 11, 2013

While this does sound interesting, it's not currently on our road map.

If you have time, we welcome any and all pull requests for review and would appreciate a pull request on this. :)

@mattyza mattyza closed this Jun 11, 2013
@crsrusl
Copy link

@crsrusl crsrusl commented Jul 1, 2013

I would also LOVE for this feature to exist in FlexSlider. It would make it amazing flexible. FlexibleSlider!

@marcamos
Copy link

@marcamos marcamos commented Apr 30, 2014

+1

7 similar comments
@ActionScripted
Copy link

@ActionScripted ActionScripted commented Jun 25, 2014

+1

@craigashby
Copy link

@craigashby craigashby commented Aug 14, 2014

+1

@wpexplorer
Copy link

@wpexplorer wpexplorer commented Sep 23, 2014

+1

@ericalli
Copy link

@ericalli ericalli commented Oct 11, 2014

+1

@philburton
Copy link

@philburton philburton commented Dec 23, 2014

+1

@yurenlimbu
Copy link

@yurenlimbu yurenlimbu commented Mar 23, 2015

+1

@rkakrik
Copy link

@rkakrik rkakrik commented Apr 4, 2015

+1

@rkakrik
Copy link

@rkakrik rkakrik commented Apr 4, 2015

Jquery.event.drag is no longer maintained. I find this library: https://github.com/mmikowski/jquery.event.ue
And similarly to example @akobashikawa:

if (slider.vars.drag) {
          slider.bind('udragstart.udrag', function(event) {
            event.preventDefault();
            var target = (event.px_delta_x < 0) ? slider.getTarget('next') : slider.getTarget('prev');
            slider.flexAnimate(target, slider.vars.pauseOnAction);
          });
        }

@nicoworq
Copy link

@nicoworq nicoworq commented Jul 14, 2015

+1

5 similar comments
@tfcmartins
Copy link

@tfcmartins tfcmartins commented Mar 20, 2016

+1

@kubik101
Copy link

@kubik101 kubik101 commented Aug 3, 2016

+1

@lauraE3
Copy link

@lauraE3 lauraE3 commented Aug 25, 2016

+1

@Eiad
Copy link

@Eiad Eiad commented Jan 5, 2017

+1

@piskello
Copy link

@piskello piskello commented Jul 27, 2018

+1

@Andrijaaa98
Copy link

@Andrijaaa98 Andrijaaa98 commented Apr 27, 2020

Is there any newer solution for draging slider? As old ones don't work for me.

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

Successfully merging a pull request may close this issue.

None yet