Jump to content
Search Community

GSAP - follow cursor + draggable content/slideshow

limbo test
Moderator Tag

Recommended Posts

Hello

 

I'm 90% there with some custom cursor  work - and wondered if anyone could spare a few mins to help me resolve a bug with the dragging of the slides with the custom cursor in place. When you click & drag (swiperJS in this instance) the cursor doesn't follow the motion and snaps back on click release.

 

I'm sure I've seen an example somewhere (codrops possibly) where it didn't do this - but I'm stretching my GSAP knowledge here.

 

Any ideas? Thanks.

 

(p.s - the content/effects below the slides are basic function tests - can ignore those).

(p.p.s - I butchered the code for the follow cursor from a post here - still getting my head round GSAP).

 

EDITED: Codepen :)

See the Pen qBRoQxx by liamcrean (@liamcrean) on CodePen

Link to comment
Share on other sites

That definitely sounds like a Swiper question. I've never used it, sorry. We really try to keep these forums focused on GSAP-specific questions. If you've got any of those, we'd love to help. 

 

Of course if anyone else wants to jump in and offer some advice, they're totally welcome to. 

 

Thanks for being a Club GreenSock member!

Link to comment
Share on other sites

 

This thread contains a solution for your problem @limbo; using pointermove instead of mousemove.

 

 

Quoting @GreenSock

 

"You're listening to "mousemove" events only, but that's not cross-browser friendly. If you put a console.log() inside the event handler, you'll see that it stops being dispatched while you're dragging (at least in some browsers). You'll probably need to listen for pointermove events at least for some browsers. But of course some older browsers don't dispatch those. And Safari uses touchmove events. So you'll need to code around that." 

 

  • Like 2
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...