Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
sum.cumo GmbH

GSAP + Vuejs no animation when element on display:none

Recommended Posts

Hey there!

 

Is there a possibility to not animate an element when it is set on display none by CSS? My current project is based on Vue.js. So I don't have that window object on mounted to detect the viewport size. So I thought it might be a nice workaround to let the animation start only if the target element is set on display block. Or is the only solution another Vue plugin to get the viewport width?

 

Thanks in advance

Kerstin

Link to post
Share on other sites
7 minutes ago, sum.cumo GmbH said:

My current project is based on Vue.js. So I don't have that window object on mounted to detect the viewport size. 

 

You can get viewport size whenever you want. It's simply window.innerWidth. If you don't have the window object, then your code is not running inside a browser.

 

 Make a very simple demo, and someone can show you.

 

  • Like 3
Link to post
Share on other sites
19 minutes ago, sum.cumo GmbH said:

So I thought it might be a nice workaround to let the animation start only if the target element is set on display block.

 

That will not work. 

 

  • Like 1
Link to post
Share on other sites

Thanks a lot for the quick reply! Seems like I had a little bug in my code. Works like butter now

  • Like 3
Link to post
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.

×