From 129e0038e734cb9a299ea017d7ce8d9a141e80ec Mon Sep 17 00:00:00 2001 From: Brian Canini <canini.16@osu.edu> Date: Mon, 8 Feb 2021 09:50:40 -0500 Subject: [PATCH] changing stickynav js function name to something more descriptive --- web/themes/asc_bootstrap/js/scripts.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/themes/asc_bootstrap/js/scripts.js b/web/themes/asc_bootstrap/js/scripts.js index 7216c24b8e..aaa4484d3f 100644 --- a/web/themes/asc_bootstrap/js/scripts.js +++ b/web/themes/asc_bootstrap/js/scripts.js @@ -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 { -- GitLab