Hi,
I have had this issue in multiple sites where I am using scrolltrigger and animating the y property. This is what happens on an <a> tag for example (see screenshot). I have had this issue also appear on normal <div> that have border properties. I have also tried to replace the border with outline for example but same thing happens.
When I hover over it, the border corrects itself and looks fine after that. Also when you change some properties through "inspect element" in chrome for example. The error also occurs in Microsoft EDGE, but have not seen it in firefox or safari.
One fix that seems to work is to not use the transform property Y but the basic TOP property. I prefer to use the Y property however.
Does anyone know how to fix this issue?
This is my code:
JS
gsap.registerPlugin(ScrollTrigger);
setTimeout(function(){
ScrollTrigger.batch('.animate-in', {
onEnter: batch => gsap.to(batch, {autoAlpha: 1, y: 0, ease: "power2.out", duration: 1.6, delay: 0.15}),
});
}, 100);
CSS animation:
.animate-in {
opacity: 0;
transform: translateY(80px);
}
CSS button:
.button {
border: 1px solid $black;
background-color: transparent;
display: inline-flex;
align-self: center;
transition: all ease-out 300ms;
padding-top: 15px;
padding-bottom: 16px;
padding-left: 22px;
padding-right: 22px;
}