4

I'd like to reproduce an effect similar to this page: http://artofflightmovie.com/ where the vertical scrollbar controls the progression of the browser "viewport" over a pre-defined path.

I am thinking the easiest way of going about this is through the use of javascript to read the scroll bar value and position background elements accordingly.

Is it possible to obtain the vertical scroll bar value in Javascript? Am I approaching this design wrong?

2 Answers 2

1

Is it possible to obtain the vertical scroll bar value in Javascript?

var scrollTop = document.documentElement.scrollTop || window.pageYOffset;

Am I approaching this design wrong?

It seems like a valid approach.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! Giving it a shot now. Seems to be reacting smoothly and giving me the data I need. Cheers
0

I would think that you'd want to:

  1. Create an element with the desired scrollbar
  2. Hook up an event handler for scroll events
  3. Write logic in that event handler for how you guide your main page depending upon the scroll position you get in the event handler

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.