Closes #176
This commit is contained in:
parent
17e13faef0
commit
299b40fcfb
1 changed files with 4 additions and 2 deletions
6
app/dist/scripts/app.js
vendored
6
app/dist/scripts/app.js
vendored
|
@ -41,7 +41,8 @@ document.querySelectorAll("a[href^='#']").forEach(anchor => {
|
||||||
anchor.addEventListener("click", event => {
|
anchor.addEventListener("click", event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
const element = event.target.href.split("#").pop();
|
const element = event.target.href.split("#").pop()
|
||||||
|
.toLowerCase();
|
||||||
let elementOffset;
|
let elementOffset;
|
||||||
|
|
||||||
if (document.getElementById(element)) {
|
if (document.getElementById(element)) {
|
||||||
|
@ -76,7 +77,8 @@ document.querySelector("[data-action='subscribe to newsletter']").onclick = () =
|
||||||
function scrollToElementOnLoad() {
|
function scrollToElementOnLoad() {
|
||||||
if (window.location.href.includes("#")) {
|
if (window.location.href.includes("#")) {
|
||||||
setTimeout(() => { // give page time to breathe
|
setTimeout(() => { // give page time to breathe
|
||||||
const element = window.location.href.split("#").pop();
|
const element = window.location.href.split("#").pop()
|
||||||
|
.toLowerCase();
|
||||||
let elementOffset;
|
let elementOffset;
|
||||||
|
|
||||||
if (document.getElementById(element)) {
|
if (document.getElementById(element)) {
|
||||||
|
|
Loading…
Reference in a new issue