Jump to content
Search Community

Draggable hitTest doesn't work in Firefox with SVG elements

pMedia 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

Thanks OSUblake for the quick response!

 

Took me a while to track down the problem. Here is my forked version of yours. 

See the Pen vQozvE by GTStan (@GTStan) on CodePen

 

No changes to your code, the only thing I added is the CSSPlugin.min.js in the setting. I use this plugin somewhere else in my application so leaving it out is not an option. Once this plugin is added, the hitTest() detection stop working in Firefox, no such problem in Mac Safari and Chrome with or without this plugin.

 

Thanks,

Stanley

 

 

Link to comment
Share on other sites

You don't need to load the CSSPlugin if you're loading TweenMax as it's included.

https://greensock.com/tweenmax

 

Draggable depends on the CSSPlugin, but you're loading it twice, which seems to be messing things up. And it seems to only cause problems when you load the CSSPlugin after Draggable.

 

PROBLEM
//cdnjs.cloudflare.com/ajax/libs/gsap/2.0.2/TweenMax.min.js
//cdnjs.cloudflare.com/ajax/libs/gsap/2.0.2/utils/Draggable.min.js
//cdnjs.cloudflare.com/ajax/libs/gsap/2.0.2/plugins/CSSPlugin.min.js

OKAY
//cdnjs.cloudflare.com/ajax/libs/gsap/2.0.2/TweenMax.min.js
//cdnjs.cloudflare.com/ajax/libs/gsap/2.0.2/plugins/CSSPlugin.min.js
//cdnjs.cloudflare.com/ajax/libs/gsap/2.0.2/utils/Draggable.min.js

 

 

But again, you don't need to load the CSSPlugin if you're loading TweenMax.

 

 

 

  • Like 6
Link to comment
Share on other sites

Thank you very much Blake! This fixed my problem in Firefox. I should have known this by thoroughly read through the online documentation. It would have saved me hours of trouble shooting on this case and another one I was about to post.

 

Thanks,

Stanley

 

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