Jump to content
Search Community

How to tween object value in gsap 3?

svyar test
Moderator Tag

Recommended Posts

data(){
  return{
    value: {
      total: 0
    }
  }
},
mounted(){
   gsap.to(this.value,1, {
     total: 1000
   });
},

This contruction now not working.

Error:   Converting circular structure to JSON
    --> starting at object with constructor 'Object'
    |     property '_gsap' -> object with constructor 'GSCache'
    --- property 'target' closes the circle

Link to comment
Share on other sites

Hey svyar and welcome.

 

You can tween an object's properties by just referring to the object and setting the property value that you want to tween to:

const foo = {bar: 0};

gsap.to(foo, {bar: 1000});

Evidently whatever this is is not what you think it is ;) If this refers to that object it should animate, all else correct. 

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