Share Posted July 11, 2019 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 More sharing options...
Share Posted July 11, 2019 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. 3 Link to comment Share on other sites More sharing options...
Share Posted July 11, 2019 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. 1 Link to comment Share on other sites More sharing options...
Author Share Posted July 11, 2019 Thanks a lot for the quick reply! Seems like I had a little bug in my code. Works like butter now 3 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now