If you have a button element that, when clicked, moves an absolutely positioned div from the bottom of the page to the top with a smooth transition lasting 1 second, you may encounter a problem. The speed of the div's movement increases as the length of the page grows, matching the duration of the transition.
My inquiry is this: Is there a method to ensure that the div maintains a constant speed, regardless of the size of the page? For instance, the div should move at a fixed rate of 5px per second without speeding up or slowing down, continuing until it reaches its final destination.
I experimented with using the transition style, but, as mentioned earlier, the div's speed escalates, which is undesirable. I am seeking a solution where the div maintains a steady pace throughout its journey.