Skip to content
Snippets Groups Projects
Commit 129e0038 authored by Brian Canini's avatar Brian Canini
Browse files

changing stickynav js function name to something more descriptive

parent 16a0bbc3
No related branches found
No related tags found
No related merge requests found
......@@ -243,8 +243,8 @@ jQuery(document).ready(function(){
// });
// When the user scrolls the page, execute myFunction
window.onscroll = function() {myFunction()};
// When the user scrolls the page, execute addStickyNav
window.onscroll = function() {addStickyNav()};
// Get the navbar
var navbar = document.getElementById("main-nav");
......@@ -253,7 +253,7 @@ var navbar = document.getElementById("main-nav");
var sticky = navbar.offsetTop;
// Add the sticky class to the navbar when you reach its scroll position. Remove "sticky" when you leave the scroll position
function myFunction() {
function addStickyNav() {
if (window.pageYOffset >= sticky) {
navbar.classList.add("sticky")
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment