Embed your demo on your marketing website or product.
Click share and select embed option
Share
. For Share via
select Website embed
. Select between the
sharing options to embed your demo on your website or product.Click Get Embed Code
Get Embed Code
to copy the code snippet. Drop this code snippet into your website or
product.data-navattic-preload="false"
data attribute to the button that is opening the demo.
Control lifecycle of the embed with Javascript
The default embed code for the lazy-load and pop-up embed types use HTML in order to make the embed process as simple as possible. If more control over the initialization and loading of the embed is required, the embeds.js script includes the Javascript class, NavatticEmbed
which includes a few methods that can be helpful for controlling the lifecycle of the embed elements:
NavatticEmbed.loadEmbeds()
: initializes all lazy-load embeds on the pageNavatticEmbed.initPopup(<embed_url>, <config>)
: adds the pop-up embed to the page but hides it until the below method is called
title
: the title that will appear in the header of the demopreload
: if this is set to false, the demo won’t be pre-loaded when it’s initialized. It will only start to render the demo when it’s opened. Defaults to true.onClose
: a callback that is triggered when the visitor closes the pop-up.NavatticEmbed.openPopup(<embed_url>)
: opens the demo so that the modal appears overlayed on the page. This would usually be attached to a click handler on the button that would be opening the pop-up demo.