{"id":18614923,"url":"https://github.com/andrewjbateman/javascript-scroll-navbar","last_synced_at":"2025-11-03T03:30:30.753Z","repository":{"id":96860611,"uuid":"161158430","full_name":"AndrewJBateman/javascript-scroll-navbar","owner":"AndrewJBateman","description":":clipboard: Uses css to add a class to change the nav bar when the user scrolls up. Wes Bos Javascript30 tutorial 24","archived":false,"fork":false,"pushed_at":"2022-04-05T07:53:17.000Z","size":2972,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-27T02:44:57.687Z","etag":null,"topics":["css3","html5","javascript30","tutorial-code"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AndrewJBateman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-10T10:36:41.000Z","updated_at":"2022-07-17T05:43:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"fb3f6d50-3bf4-440a-a459-fed867cac3ff","html_url":"https://github.com/AndrewJBateman/javascript-scroll-navbar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-scroll-navbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-scroll-navbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-scroll-navbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2Fjavascript-scroll-navbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/javascript-scroll-navbar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239406449,"owners_count":19633024,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css3","html5","javascript30","tutorial-code"],"created_at":"2024-11-07T03:27:26.304Z","updated_at":"2025-11-03T03:30:30.704Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"HTML","readme":"# :zap: Javascript Scroll Navbar\n\n* Wes Bos Youtube Tutorial: [Vanilla JavaScript Sticky Nav - #JavaScript30 24/30](https://www.youtube.com/watch?v=5FLOBCGH3_U\u0026list=PLu8EoSxDXHP6CGK4YVJhL_VWetA865GOH\u0026index=24).\n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/javascript-scroll-navbar?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/javascript-scroll-navbar?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/javascript-scroll-navbar?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/javascript-scroll-navbar?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Javascript Scroll Navbar](#zap-javascript-scroll-navbar)\n  * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal_strength: Technologies](#signal_strength-technologies)\n  * [:floppy_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \u0026 To-Do List](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:file_folder: License](#file_folder-license)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* Tutorial Code to add a class to change the nav bar when the user scrolls. Also changes the width of the text div.\n\n## :camera: Screenshots\n\n![Example screenshot](./img/nav.png).\n\n## :signal_strength: Technologies\n\n* [Javascript v1.9 ECMA-262 ECMAScript 2018](http://www.ecma-international.org/publications/standards/Ecma-262.htm)\n\n## :floppy_disk: Setup\n\n* Open `index.html` in browser. If any code is changed the browser needs to be refreshed.\n\n## :computer: Code Examples\n\n* compares scroll position with top of Navigation and adds the 'fixed-nav' class when they are equal.\n\n```javascript\nfixNav = () =\u003e {\n  console.log('window.scrollY', window.scrollY, 'topOfNav', topOfNav);\n  if(window.scrollY \u003e= topOfNav) {\n    console.info('window.scrollY \u003e= topOfNav');\n    document.body.style.paddingTop = nav.offsetHeight + 'px';\n    document.body.classList.add('fixed-nav'); \n  } else {\n    document.body.style.paddingTop = 0;\n    document.body.classList.remove('fixed-nav'); \n  }\n}\n```\n\n## :cool: Features\n\n* At about scrollY = 337px the css class change occurs to 'fixed-nav'.\n\n## :clipboard: Status \u0026 To-Do List\n\n* Status: Working.\n* To-Do: Nothing\n\n## :clap: Inspiration\n\n* Wes Bos Youtube Tutorial: [Vanilla JavaScript Sticky Nav - #JavaScript30 24/30](https://www.youtube.com/watch?v=5FLOBCGH3_U\u0026list=PLu8EoSxDXHP6CGK4YVJhL_VWetA865GOH\u0026index=24)\n\n## :file_folder: License\n\n* N/A\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fjavascript-scroll-navbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Fjavascript-scroll-navbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Fjavascript-scroll-navbar/lists"}