La fonction de suggestion automatique permet d'affiner rapidement votre recherche en suggérant des correspondances possibles au fur et à mesure de la frappe.
I'm not sure if this is the best place to post this, but we have the chat widget showing on our custom app. When the user prints using the browser, it shows the chat widget on the printed page (and the print preview).
We have tried hiding it by adding the 'd-print-none' class (we're using bootstrap) and also tried adding the 'display:none' to the style of the hubspot chat widget div.
my install is not on wordpress, so maybe that's the issue, but media queries didn't actually work for me.
something in the html inside the iframe was overriding any css i applied on my site.
it did get rid of "some" of the chat widget but parts were still showing through.
turns out what i was able to do was to use the `beforeprint` and `afterprint` events and some javascript to set the `display` property in the style of the `iframe` itself. also, it was key that we added the `!important` modifier, otherwise it doesn't work.
like this...
// HIDE CHAT BOX ON PRINT
window.addEventListener("beforeprint", function (event) {
const liveFrame = document.querySelector("#hubspot-messages-iframe-container > iframe");
if (liveFrame != null) {
liveFrame.style.setProperty("display", "none", "important");
}
});
window.addEventListener("afterprint", function (event) {
const liveFrame = document.querySelector("#hubspot-messages-iframe-container > iframe");
if (liveFrame != null) {
liveFrame.style.removeProperty("display");
}
});
my install is not on wordpress, so maybe that's the issue, but media queries didn't actually work for me.
something in the html inside the iframe was overriding any css i applied on my site.
it did get rid of "some" of the chat widget but parts were still showing through.
turns out what i was able to do was to use the `beforeprint` and `afterprint` events and some javascript to set the `display` property in the style of the `iframe` itself. also, it was key that we added the `!important` modifier, otherwise it doesn't work.
like this...
// HIDE CHAT BOX ON PRINT
window.addEventListener("beforeprint", function (event) {
const liveFrame = document.querySelector("#hubspot-messages-iframe-container > iframe");
if (liveFrame != null) {
liveFrame.style.setProperty("display", "none", "important");
}
});
window.addEventListener("afterprint", function (event) {
const liveFrame = document.querySelector("#hubspot-messages-iframe-container > iframe");
if (liveFrame != null) {
liveFrame.style.removeProperty("display");
}
});