Jump to content
Search Community

Draggable using two-finger scroll on trackpad OR mouse-wheel scroll?

kristoffer test
Moderator Tag

Recommended Posts

I'm using the vertical full-screen slider from PointC (see codepen). I really like how the Draggable does the scroll motion and page-snapping. I wonder if this can be extended to using two-finger scroll on a trackpad and/or using mouse-wheel scroll? OR if it is somehow possible to "trick" the mousewheel / trackpad scroll signal into being a click-and-drag motion instead?

 

I did search the forums, and I found this post from Sahil, but hoping maybe there is an easier (and newer) way to do it:

 

Thanks,

Kristoffer

 

See the Pen MzWzyv by PointC (@PointC) on CodePen

Link to comment
Share on other sites

5 hours ago, kristoffer said:

I really like how the Draggable does the scroll motion and page-snapping. I wonder if this can be extended to using two-finger scroll on a trackpad and/or using mouse-wheel scroll? OR if it is somehow possible to "trick" the mousewheel / trackpad scroll signal into being a click-and-drag motion instead?

By "how the Draggable does the scroll motion and page-snapping" do you mean how if you start dragging it will partially go to the next slide and if you don't go far enough snap back into place? 

 

If so, the answer is kind of. It's doable but not the cleanest and may require some tweaking. See this post:

 

It might be easier to recreate the same sort of functionality without using Draggable directly, just moving the scroll position based on velocity, acceleration, and snap values.

  • Like 1
Link to comment
Share on other sites

1 hour ago, ZachSaucier said:

By "how the Draggable does the scroll motion and page-snapping" do you mean how if you start dragging it will partially go to the next slide and if you don't go far enough snap back into place? 

 

If so, the answer is kind of. It's doable but not the cleanest and may require some tweaking. See this post:

 

It might be easier to recreate the same sort of functionality without using Draggable directly, just moving the scroll position based on velocity, acceleration, and snap values.

Thanks for your reply. So I guess it has do be done the "hard way", no easy shortcut through the Draggable plugin. Ok, I'll try to see if i can use some ideas from that post.

Thanks,

Kristoffer 

Link to comment
Share on other sites

15 hours ago, Shrug ¯\_(ツ)_/¯ said:

Very nice! Thank you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...