I have a Typeform embedded on a Wordpress site and there’s no way to hide it on mobile. I tried wrapping the code in a:
<div class="hide-on-mobile">
<typeform code>
<div>
with this CSS:
@media only screen and (max-width: 767px) { .hide-on-mobile { display: none !important; } }
But no success. So I tried:
<script>
function hideTypeformOnMobile() {
if (window.innerWidth <= 767) {
var typeform = document.querySelector('#typeform');
typeform.style.display = 'none';
}
}
window.addEventListener('load', hideTypeformOnMobile);
window.addEventListener('resize', hideTypeformOnMobile);
</script>
<div id="typeform">
<!-- Your typeform code goes here -->
</div>
And nothing, still shows.
Anyone can help me?
Thanks in advance,