Answer the question
In order to leave comments, you need to log in
How to fix animation performance?
So it goes.
There is an animation code:
if ( $('.landing__superdesign').length ) {
let f = $('.landing__superdesign-f');
let s = $('.landing__superdesign-s');
let t = $('.landing__superdesign-t');
let parallax = () => {
let scrollTop = $('.wrap').scrollTop();
f.css('transform', 'translateY(' + scrollTop/10 + 'px)');
s.css('transform', 'translateY(' + -scrollTop/10 + 'px)');
t.css('transform', 'rotate(' + (45 + scrollTop/10) + 'deg)');
window.requestAnimationFrame(parallax);
};
window.requestAnimationFrame(parallax);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question