docwho
docwho

Reputation: 73

How to add a delay in loading a Shopify snippet?

I would like to add a delay in the call of the snippet.

Currently I am calling the snippet via an include. {% include 'mySnippet' %}

How can I add a delay of 1000ms before calling the snippet?

Inside the snippet there is a form that uses liquid objects to define the value.

Upvotes: 0

Views: 1658

Answers (1)

David Lazar
David Lazar

Reputation: 11427

You cannot do this. Include files are rendered server side and you cannot touch that pipeline. Instead, do the more obvious thing and render your snippet HTML in a container that is hidden. Use Javascript to unhide the container when you are ready, for example 1000ms after the page assets have loaded.

Upvotes: 1

Related Questions