samlinck Posted May 11, 2021 Share Posted May 11, 2021 I have page transitions with barba.js and a certain element is not always on the page to be animated. So gsap gives a warning that the target is not found. Can I just disable warnings in my production env. Or is there a good way to not let a certain part of the animation timeline play, when the target isn't found? Link to comment Share on other sites More sharing options...
Cassie Posted May 11, 2021 Share Posted May 11, 2021 if(element){ tl.to(element, { rotate: 90, }, 3) } Always better to fix warnings if you can. You could maybe add that particular tween to the timeline if it exists? You can also adjust the config like so - gsap.config({ nullTargetWarn: false }); more info 4 1 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