Liquid, JavaScript, themes, sales channels
We would like to call a Javascript function using the Image with Text Overlay section's Button link. The text box for the link entry does not appear to allow such a javascript call to be entered. See image below. Any suggestions you have would be much appreciated.
John
@jfkScollar
You can't. You'll need to create an event listener on that button and, whenever it's clicked, you can call the function you wish.
Kind regards,
Diego
Hi @diego_ezfy,
Thank you for your response.
As the Button's class is generic and there are multiple Buttons that have the same class, how is one to assign an unique ID to the button to create an event listener on that button?
Thanks,
John
Hi @lucas05021,
I haven't. Thanks for asking. Hoping someone has and can post it here.
I'm disappointed that Shopify does not support javascript function calls to be entered for Links (hrefs) in their editor. Javascript function calls in hrefs are such a normal (and powerful) approach to custom functionality.
John
User | RANK |
---|---|
25 | |
21 | |
8 | |
7 | |
6 |
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023