Skip to content

Commit

Permalink
"===" and "!==" should be used instead of "==" and "!=" (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stargator authored Aug 11, 2020
1 parent 3be9f74 commit 50523b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ $(function(){
// change nav bar visibility on scroll
function onScroll() {
var isNavBarVisible = window.pageYOffset >= showNavBarMinimum;
if ( isNavBarVisible != wasNavBarVisible ) {
if ( isNavBarVisible !== wasNavBarVisible ) {
$navBar.toggleClass('show');
wasNavBarVisible = isNavBarVisible;
}
Expand Down Expand Up @@ -36,7 +36,7 @@ $(function(){

// Scroll Animations
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
if (location.pathname.replace(/^\//,'') === this.pathname.replace(/^\//,'') && location.hostname === this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
Expand Down

0 comments on commit 50523b8

Please sign in to comment.