This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(function ($) { | |
$(document).ready(function () { | |
const baseUrl = window.location.href.split('?')[0]; | |
//Set any search, radius and/or categories from URL params on map load | |
if (typeof WPGMZA != 'undefined' && WPGMZA != null) { | |
let url = new URL(window.location.href); | |
let search = url.searchParams.get("search"); | |
let radius = url.searchParams.get("radius"); | |
let categories = url.searchParams.get("categories"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Smooth scroll on page load if anchor is in URL | |
if (window.location.hash) { | |
var hash = window.location.hash; | |
$('html,body').animate({ | |
scrollTop: $(hash).offset().top - 200 | |
}, 1000); | |
} | |
//Smooth scroll to anchor when clicking on a link | |
$('a[href*="#"]:not([href="#"])').click(function (event) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* | |
* Smooth Scroll to Anchors | |
* */ | |
const offsetTopScroll = 200; | |
//Smooth scroll on page load if anchor is in URL | |
if (window.location.hash) { | |
const hash = window.location.hash; | |
const target = document.getElementById(hash.replace('#', '')); |