All things Shopify and commerce
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
I have a button embeded in an image that says 'check out our product range'. Instead of clicking this button and going to another page, I want to click this button and the product menu opens automatically from the header.
This is the button I want to push and I want it to open the menu in the image below.
This image shows all the options on the one page.
Thanks for your help.
Add js code to theme.liquid file
<script>
var btn = document.querySelector('.slideshow-button');
var menu = document.querySelector('#products_toggle');
var submenu =document.querySelector('.navmenu-meganav-item-parent .navmenu-submenu');
btn.addEventListener('click',function(e){
e.preventDefault();
menu.classList.add('navmenu-active');
submenu.classList.add('visible');
});
</script>