From 7f2863fe93521e9653c2023bf5df432402a88d2c Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Fri, 11 Dec 2020 02:22:55 +0100 Subject: [PATCH 1/3] Fix deprecated event shorthand --- js/script.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/script.js b/js/script.js index 2144717..0a417d0 100644 --- a/js/script.js +++ b/js/script.js @@ -25,7 +25,7 @@ jQuery(function($) { // Show and hide the scroll to top link based on scroll position scrollElem.hide(); - $(window).scroll(function () { + $(window).on('scroll',function () { var scrollTop = $(document).scrollTop(); if ( scrollTop > upperLimit ) { $(scrollElem).stop().fadeTo(300, 1); // fade back in @@ -35,7 +35,7 @@ jQuery(function($) { }); // Scroll to top animation on click - $(scrollElem).click(function(){ + $(scrollElem).on('click',function(){ $('html, body').animate({scrollTop:0}, scrollSpeed, scrollStyle ); return false; }); @@ -45,7 +45,7 @@ jQuery(function($) { * * ****************************************************/ - $('a[href*="#"]:not([href="#"]):not([href^="#tab"]):not([href^="#collapse"])').click(function() + $('a[href*="#"]:not([href="#"]):not([href^="#tab"]):not([href^="#collapse"])').on('click',function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) @@ -71,4 +71,4 @@ jQuery(function($) { * * ****************************************************/ -}); \ No newline at end of file +}); From a934f2eabc61a35fb8422f49407fd9b2730e97db Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Fri, 11 Dec 2020 02:28:14 +0100 Subject: [PATCH 2/3] Remove unused declaration for `headerHeight` --- js/script.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/script.js b/js/script.js index 0a417d0..c1491aa 100644 --- a/js/script.js +++ b/js/script.js @@ -52,7 +52,6 @@ jQuery(function($) { { var target = $(this.hash), - headerHeight = $(".primary-header").height() + 5; // Get fixed header height target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); From 5f569ef472a5bb453a8be50a8fbec31583a1d035 Mon Sep 17 00:00:00 2001 From: IanDelMar <42134098+IanDelMar@users.noreply.github.com> Date: Fri, 11 Dec 2020 02:32:59 +0100 Subject: [PATCH 3/3] Re-minify script --- js/script.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/script.min.js b/js/script.min.js index 03f56a8..c39f568 100644 --- a/js/script.min.js +++ b/js/script.min.js @@ -1 +1 @@ -jQuery.noConflict(),jQuery(function(o){var t=100,e=o("a#scroll-to-top"),n=600,a="swing";e.hide(),o(window).scroll(function(){var n=o(document).scrollTop();n>t?o(e).stop().fadeTo(300,1):o(e).stop().fadeTo(300,0)}),o(e).click(function(){return o("html, body").animate({scrollTop:0},n,a),!1}),o('a[href*="#"]:not([href="#"]):not([href^="#tab"]):not([href^="#collapse"])').click(function(){if(location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")||location.hostname==this.hostname){var t=o(this.hash);o(".primary-header").height()+5;if(t=t.length?t:o("[name="+this.hash.slice(1)+"]"),t.length)return o("html,body").animate({scrollTop:t.offset().top},n,a),!1}})}); \ No newline at end of file +jQuery.noConflict(),jQuery((function(o){var t=o("a#scroll-to-top"),n="swing";t.hide(),o(window).on("scroll",(function(){o(document).scrollTop()>100?o(t).stop().fadeTo(300,1):o(t).stop().fadeTo(300,0)})),o(t).on("click",(function(){return o("html, body").animate({scrollTop:0},600,n),!1})),o('a[href*="#"]:not([href="#"]):not([href^="#tab"]):not([href^="#collapse"])').on("click",(function(){var t;if((location.pathname.replace(/^\//,"")==this.pathname.replace(/^\//,"")||location.hostname==this.hostname)&&(t=(t=o(this.hash)).length?t:o("[name="+this.hash.slice(1)+"]")).length)return o("html,body").animate({scrollTop:t.offset().top},600,n),!1}))}));