From the course: CSS: Scrolling and Parallax

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Determining when an object first appears

Determining when an object first appears - CSS Tutorial

From the course: CSS: Scrolling and Parallax

Determining when an object first appears

- [Instructor] As you can tell controlling objects is largely based on where the objects are and that's actually in relationship to not just where we are scrolling the object but also the current view port which means the viewable area of the screen. And remember that that could be a mobile device or a browser. So browsers are re-sizeable, we need to consider that sometimes things resize. Now we've already taken a peak of one of the properties that is relevant here in the last video, so that was window.innerHeight. That is going to tell you the height of the current view port or window and that depends on the size of the current window which as I mentioned can be resized. Of course there is another variable called innerWidth that just tells you the width of the current window. And so we need to reconsider how an element is positioned based on where we are on not just the scrolling of the page but also these different…

Contents