Lab 37: Sticky Nav


This lab focused solely on the navigation bar. Most nav bars are sort of placed and forced to the top of the page and, in most cases, to reach the nav bar, you have to scroll all the way to the top of the page. With sticky nav bars, the actual nav bar stays on the top of the page no matter if you scroll down.  The main coding logic behind making this lab possible is setting the y value of the window equal to the top of the nav bar, this would create the visual of the nav bar never leaving. there is another part of the lab where when you scroll, another section to the nav bar is added, which is part of a simple if-else statement that makes it so when you scroll, a class list is added to the HTML document.  This is a simple addition to the webpage, but it is definitely something important to know because it just adds a very nice aesthetic and makes the nav bar more accessible throughout the page.




Comments

Popular posts from this blog

Lab 23-2: Type Ahead

WBL Workshop 2

Lab7 - Simple Accordion