Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
narb

getBBox is not a function

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

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

  • Like 4
Link to comment
Share on other sites

I will work to get a codepen together. Thanks for noticing the typo, I do have it correct in the code I'm trying to run.

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