Hi @micaelah, that’s right there’s not currently a built in method to do this type of manipulation, but the ideas forum would be a great place to start! That said, you can use a bit of a hacky workaround where you hide the messages widget all the time, then only decide to show it when the window is 50% scrolled, or after a certain amount of time.
They’re not really supported features, but the code would be something like this:
For the chat widget to appear after 3 seconds:
In the head HTML put this CSS
<style>
div#hubspot-messages-iframe-container {
display: none!important;
}
</style>
In the Footer HTML put this code:
<script>
setTimeout(function() {
$("body #hubspot-messages-iframe-container").css("cssText", "display: block!important");
$("body #hubspot-messages-iframe-container").css("height", "234px");
$("body #hubspot-messages-iframe-container").css("width", "276px");
}, 3000)
</script>
The part at the end, after the comma where it says 3000 is the amount of time that the browser should wait after load for the code to be fired. This is in milliseconds. If you wanted the code to be fired after 10 seconds, you’d use 10000 in place of 3000
For the chat widget to appear after 50% scrolled:
Same CSS as above in the Head HTML
In the Footer HTML:
<script>
$(window).scroll(function() {
if($(window).scrollTop() / $(window).height() > .5) {
$("body #hubspot-messages-iframe-container").css("cssText", "display: block!important");
$("body #hubspot-messages-iframe-container").css("height", "234px");
$("body #hubspot-messages-iframe-container").css("width", "276px");
$(window).unbind("scroll");
}
});
</script>