Jump to content
Search Community

Speed Question...

mimeartist test
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

I'm trying out quickSetter, whereby I'm changing nine boxes' x, y, width and height... is quick setter the best way to do this... eg. 

 

let box_1_1_x = gsap.quickSetter("#box_1_1", "x", "px");
let box_1_1_y = gsap.quickSetter("#box_1_1", "y", "px");
    
let box_1_1_width = gsap.quickSetter("#box_1_1", "width", "px");
let box_1_1_height = gsap.quickSetter("#box_1_1", "height", "px");

 

box_1_1_x(0);
box_1_1_y(0);
box_1_1_width(completeArray[0]);
box_1_1_height(completeArray[3]);

 

 

or is it just as fast to do, (it's definitely less code :D)

 

 

gsap.set('#box_1_1', { width: completeArray[0], height: completeArray[3], x: 0, y: 0 });

 

 

Link to comment
Share on other sites

  • Solution

I doubt there'd be much of a noticeable difference, honestly. Technically the quickSetters might be very slightly faster, but you could benchmark it in your particular scenario if you're really curious. 

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