Question:
How can I set an anchor on a global section (Abschnitt)?
Product:
Wix Studio
What are you trying to achieve:
I want a contact buttton in my menu. by clicking it should scroll down to my contact section.
What have you already tried:
I can give a section an anchor and use the menu link to scroll to it. I can do that step first and set the section after that to global and the link still works but the anchor ist not to find anymore in the anchor list or in the edit-panel anymore >> I can not change it anymore.
If I set first the section on global and then want to make it an anchor, its not possible.
Additional information:
working on Mac in Firefox
What do I oversee? Thanks so much for your help!
Katja
I did a video similar to this a while back [it’s not exactly the same as the video is about external anchor links] but if the form is a global section and I’ll assume the contact button is in the header, this should work to navigate to the form (or whatever element you want to be anchor point). It works on all pages with the global section since the elements within keep the same ID across multiple pages.
//Make sure if the button is in the header, make sure this is within the masterPage.js
//update #contactForm with your form's ID
let contact = $w('#contactForm')
$w.onReady(function () {
//update #contactButton
$w('#contactButton').onClick((event) => {
contact.scrollTo();
})
});