简体   繁体   中英

How to bind an event on a section load Shopify

I would like to bind an event on shopify section load in admin I mean while working on the Customize theme .

For example working on slider in Shopify customizer. We might need some jQuery script that runs on the section load. This should be called every time while we change anything from customizer.

I tried the shopify:section:load event but did not get any success.

Put it in section javascript tag

{% javascript %}
function showAlert() {
  alert('listen to shopify theme editor re-render');
}

document.addEventListener("shopify:section:load", showAlert);
{% endjavascript %}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM