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!!!
As 2024 wraps up, the dropshipping landscape is already shifting towards 2025's trends....
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024