Jump to content
GreenSock

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

"display" applied a frame before x/y updates causing "flashing" in single .set()

Recommended Posts

Hi,

 

I'm trying something like (pseudo code):

 

.set({x: newX, y:newY, display: 'block'})

 

to both show an item and place it at a new location. But it flashes briefly at the old location, indicating that the display property gets updated one frame before the X/Y updates. Even though "set" shouldn't cause an animation, it seems to go through the animation system somehow.

 

Is there a way to ensure the position is updated BEFORE the display  property is changed?

 

Placing them in separate .set() commands doesn't work.

 

Regards,

Sven

Link to comment
Share on other sites

I've tried one more thing, which seems to work:

 

.set({x: newX, y: newY, immediateRender: true})
.to(0, {display: 'block'})
 
I am guessing that this takes 2 frames to execute, though.
 
I'm still curious why this works this way, and why neither a single .set nor two consecutive .set work as one would expect. It seems to me that all properties in a single .set() statement should execute in the same frame.
Link to comment
Share on other sites

Hi killroy :)

 

as we asked you previously , pls make a Codepen Demo available for your questions .

 

anyway , i can't see any flash or delay : 

See the Pen JdNzEJ by MAW (@MAW) on CodePen

  • Like 1
Link to comment
Share on other sites

Excellent demo, Diaco.

Not seeing any flash on this end either.

  • Like 1
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.
×