Shopify themes, liquid, logos, and UX
Hi all,
I'm trying to create an anchor link on the homepage.
It completely worked with the section id, and adding smooth scroll to the theme.liquid file.
The only problem I'm facing is the change in url when the button is being clicked. The section id appears in the url.
Is there a way to hide this?
Store: https://beestn.nl
Pw: 321
(The first button above the fold that says 'ontdekken')
Thanks so much!
Solved! Go to the solution
This is an accepted solution.
Hey @Gijsvl please add the below javascript code to the js file.
const appointmenbuttonlearnmore = document.querySelector('.content-box__buttons a');
appointmenbuttonlearnmore.addEventListener('click', () => {
const appointmentFullElement = document.querySelector('.testimonials-template--20692094812491__ss_testimonial_8_wfX9yK');
if (appointmentFullElement) {
appointmentFullElement.scrollIntoView({ behavior: 'smooth' });
}
});
Also remove href for the button on the banner. https://prnt.sc/oYa7LzhVyCAv
This is an accepted solution.
Hey @Gijsvl please add the below javascript code to the js file.
const appointmenbuttonlearnmore = document.querySelector('.content-box__buttons a');
appointmenbuttonlearnmore.addEventListener('click', () => {
const appointmentFullElement = document.querySelector('.testimonials-template--20692094812491__ss_testimonial_8_wfX9yK');
if (appointmentFullElement) {
appointmentFullElement.scrollIntoView({ behavior: 'smooth' });
}
});
Also remove href for the button on the banner. https://prnt.sc/oYa7LzhVyCAv
Works perfectly, thanks so much!!!
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024