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 - 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
-
-
-
-
-
Building your new monsters section9m 41s
-
(Locked)
Smooth scrolling on link clicks2m 48s
-
(Locked)
Request animation frame4m 22s
-
(Locked)
Adding classes when scrolling4m 3s
-
(Locked)
Removing the header cue when scrolling3m 50s
-
(Locked)
Parallax scrolling with JavaScript8m 35s
-
(Locked)
Determining when an object first appears7m 36s
-
(Locked)
Animating when objects enter the screen4m 15s
-
(Locked)
Randomizing the appearance5m 26s
-
-
-
-
-