Jump to content
Search Community

GSAP + Vuejs no animation when element on display:none

sum.cumo GmbH test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

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