Plugin Contributor
Lap
(@lapzor)
When editing a box there should be a choice in the right top corner of the editor for “visual” or “text”. If you click on “text” you can add HTML and JavaScript code.
I thought the problem was the JavaScript, but it is actually that the hubspot form script is firing when the page loads, embedding the form at the bottom of the site, and not inside the box (which is fired at 65% scroll). Is there a way to keep the script from loading until the box loads?
Hi Jim,
We’ve just added this short article on Boxzilla’s JavaScript events to our knowledge base.
Basically what you want to do is use the Boxzilla.on(event, callback) function to delay your function execution until a certain event fires.
<script>
Boxzilla.on('box.show', function(box) {
// your hubspot code goes here
});
</script>
Hope that helps!
I couldn’t get it to inject the hubspot code into a div in the box. I think if the editor had a raw html mode it may work. I ended up putting in a custom form and doing an API call to Hubspot.