Here is the current code I am using:
.s2 {
top: 150px;
left: 20px;
position: absolute;
transition: left 300ms linear;
}
I am currently updating the left position dynamically using JavaScript based on scroll events. However, I have noticed that the performance is subpar on mobile devices and even desktop browsers.
Are there any suggestions for improving the performance of this code? Is there a more efficient approach to achieve the same functionality?