Jump to content
Search Community

getBBox is not a function

narb 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

I have an SVG I'm trying to align to a path using pathDataToBezier().

 

When I do not include an align parameter the animation plays normally with code below.

 

 ferry_motionPath = MorphSVGPlugin.pathDataToBezier("#shep_path");
$("#test_ferry").click(function(){
    tween=TweenLite.to("#shep_ferry",60,{bezier:{values:shep_motionPath, type:"cubic"}, ease: Power1.easeIn});
  });

 

when I change this to align to the object as below:

 

 ferry_motionPath = MorphSVGPlugin.pathDataToBezier("#shep_path", {align:"#shep_ferry"});

 

I'm getting the error:

jQuery.Deferred exception: k[0].getBBox is not a function K.pathDataToBezier@***********/js/gsap/plugins/MorphSVGPlugin.min.js:13:12096

TypeError: k[0].getBBox is not a function

 

I am loading TweenMax and the MorphSVGPlugin, is there another dependancy I am missing?

Link to comment
Share on other sites

Hi @narb :)

 

Welcome to the forum and thank for being a Club member.

 

I noticed the values for your bezier tween are shep_motionPath, but the you're using ferry_motionPath as the name when you're converting the path to bezier. Is that just a typo in your post or is there another path that isn't listed?

 

If you could put this into a CodePen demo for us, it would be easier to troubleshoot. Here's some more info about that:

 

 Happy tweening.

:)

  • Like 3
Link to comment
Share on other sites

2 minutes ago, GreenSock said:

It sure sounds like #shep_ferry isn't an SVG element - is that right? It needs to be SVG. 

 

This is exactly my problem. Thank you very much.

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