In relation to a question I posted on here yesterday, I am trying to get a div which moves horizontally when scrolling, however it only goes so far across (because it’s the total window width subtracting the amount scrolled vertically) but I would like this div to go all of the way across the page…how would I do this?
Share
As I answered the question yesterday, I’ll chime in here, too.
Adding the following to your scroll handler
Shows that the block continues moving after it is out of view. If you need it to move faster (ie if you want it to move across the whole width of the window whilst still in view), then simply multiply up the left value as follows:
The edit above makes the block move twice as fast (the *2 multiplier on the end). If you need it to move even faster, use *3 and so on.
As commented on your question, I know it is tempting to use SO as a code generation tool, but this kind of issue is relatively simple to solve yourself with a little logic and some trial and error… You should try to do some research before coming here to ask the question in future, perhaps.