Lab #37 Sticky Nav

The title of this lab is "Sticky Nav". As the name indicates, I created a website that included a navigation bar that is sticky. This generally means that if you scroll down the page, the navigation bar should follow you and be on the page at all times.


To make the navigation bar sticky, I first created the navigation bar using an unordered list with list items containing each panel. This list was inside of a <nav> tag which is tagged with an id called "main". The CSS linked with it was styled with a black background and text that was white to compliment my page colors. There wasn't that much JavaScript involved in making this function, but it is worth mentioning because the feature wouldn't function properly without it. The JavaScript consisted of a query selector that got the data of the nav tag and then updates the location of the navbar to the top of the page as you scroll to the bottom of the page. When you scroll up, the navigation bar gets locked to the bottom.

Web designers can make navigation bars like this to make the users' lives easier in trying to work their way around your page. For instance, say you make an article website and the user is all the way at the bottom of the page after reading a long essay. This sticky navigation bar would allow for the user to be able to translate to another page from anywhere on the page instead of having to scroll all the way back up to "navigate the navigation bar."

Comments

Popular posts from this blog

WBL Workshop #6 Interview Skills

CTE Expo Reflection Journal

Lab #12 Reflection