update code comments in scripts

This commit is contained in:
David Miller 2021-03-29 15:59:18 -04:00
parent 28f356391c
commit 0bcdad5961
2 changed files with 12 additions and 10 deletions

11
dist/js/scripts.js vendored
View File

@ -6,17 +6,17 @@
(function ($) { (function ($) {
"use strict"; // Start of use strict "use strict"; // Start of use strict
// Smooth scrolling using jQuery easing // Smooth scrolling using anime.js
$('a.js-scroll-trigger[href*="#"]:not([href="#"])').on('click', function () { $('a.js-scroll-trigger[href*="#"]:not([href="#"])').on('click', function () {
if ( if (
location.pathname.replace(/^\//, "") == location.pathname.replace(/^\//, "") ==
this.pathname.replace(/^\//, "") && this.pathname.replace(/^\//, "") &&
location.hostname == this.hostname location.hostname == this.hostname
) { ) {
var target = $(this.hash); var target = $(this.hash);
target = target.length target = target.length ?
? target target :
: $("[name=" + this.hash.slice(1) + "]"); $("[name=" + this.hash.slice(1) + "]");
if (target.length) { if (target.length) {
anime({ anime({
targets: 'html, body', targets: 'html, body',
@ -52,4 +52,5 @@
navbarCollapse(); navbarCollapse();
// Collapse the navbar when page is scrolled // Collapse the navbar when page is scrolled
$(window).on('scroll', navbarCollapse); $(window).on('scroll', navbarCollapse);
})(jQuery); // End of use strict })(jQuery); // End of use strict

View File

@ -1,17 +1,17 @@
(function ($) { (function ($) {
"use strict"; // Start of use strict "use strict"; // Start of use strict
// Smooth scrolling using jQuery easing // Smooth scrolling using anime.js
$('a.js-scroll-trigger[href*="#"]:not([href="#"])').on('click', function () { $('a.js-scroll-trigger[href*="#"]:not([href="#"])').on('click', function () {
if ( if (
location.pathname.replace(/^\//, "") == location.pathname.replace(/^\//, "") ==
this.pathname.replace(/^\//, "") && this.pathname.replace(/^\//, "") &&
location.hostname == this.hostname location.hostname == this.hostname
) { ) {
var target = $(this.hash); var target = $(this.hash);
target = target.length target = target.length ?
? target target :
: $("[name=" + this.hash.slice(1) + "]"); $("[name=" + this.hash.slice(1) + "]");
if (target.length) { if (target.length) {
anime({ anime({
targets: 'html, body', targets: 'html, body',
@ -47,4 +47,5 @@
navbarCollapse(); navbarCollapse();
// Collapse the navbar when page is scrolled // Collapse the navbar when page is scrolled
$(window).on('scroll', navbarCollapse); $(window).on('scroll', navbarCollapse);
})(jQuery); // End of use strict })(jQuery); // End of use strict