Jump to content
Search Community

Have a separate "events" plugin? (To Trigger Twine and letting it take care of the mobile/desktop gap?)

Jérome test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Draggable (for example) provides a great events handler, which cover transparently the gap between mobile and desktop (touch/click, release, dragStart (with finger or mouse), etc...).

 

Is it possible to use your nice events handler without any dependency on another plugin? To attach directly our own listeners which will can for example trigger specific Tween?...

 

I have not seen this plugin/core feature accessible in the library of GreenSock for now.

Link to comment
Share on other sites

I thought about abstracting that type of functionality out into its own class, but ultimately decided to bake it into Draggable itself for several reasons:

  1. A lot of the functionality is very closely tied (and specific to) Draggable itself and doesn't lend itself to easy abstraction. 
  2. Abstracting it out into its own class would require building in some extra hooks and infrastructure that'd increase file size. I didn't think the payoff was worth it.
  3. I didn't want to create another class that'd be a dependency.

We may still pursue this at some point, but not right now. I have heard that Hammer.js is good for this sort of thing, but I've never personally used it so I can't vouch for it. 

 

Does that answer your question?

Link to comment
Share on other sites

Ok, thanks!

I understand the problematic.

 

For now I use Hammer.js, but it can be capricious (like trigger 2-3 events simultaneously on the same listener) :).

But it is still manageable.

 

Have a good day!

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...