Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

In case you’re adding a Visualizer banner on your website or a button in the menu, a trigger to redirect users to the Visualizer is to be added. Please check our short instruction to see how.

Step 1. You need to add a button to a page with any URL.

Step 2. Add #visualizer in the end of the URL: URL#visualizer/.

Step 3. Hide your Wizart button (just add display: none; to the css file of your Wizart button). And then add the following code:

<script type="application/javascript" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"></script>
<script>
    document.addEventListener("DOMContentLoaded", () => {
        const floatingButton = new window.WFloatingButton({
           token: "your token for wizart",
           element: document.getElementsByTagName("body")[0]
       });
       floatingButton.render({className: 'wizart-homepage'});
       
       $($('.class').find('a[href$="#visualizer"]')).click(function(e){
             e.preventDefault();
             $('.wizart-homepage').trigger('click'); 
      });
});
</script>

<style>
     .wizart-homepage {display: none!important;}
</style>

 .class - this is css class of your custom button. For example in the screenshot you want to set a custom button to the menu, so you need to find a parent <div> for your button.

In another case, you can use any attribute: id, class or another attribute for you parent for button.

If you want to use id of your button, please use #id instead of .class.

How it works? Click on the custom menu button and make a trigger to a real Wizart button.

  • No labels