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:
1<div class="hide-on-mobile">23 <typeform code>45<div>
with this CSS:
1@media only screen and (max-width: 767px) { .hide-on-mobile { display: none !important; } }
But no success. So I tried:
1<script>2 function hideTypeformOnMobile() {3 if (window.innerWidth <= 767) {4 var typeform = document.querySelector('#typeform');5 typeform.style.display = 'none';6 }7 }89 window.addEventListener('load', hideTypeformOnMobile);10 window.addEventListener('resize', hideTypeformOnMobile);11</script>1213<div id="typeform">14 <!-- Your typeform code goes here -->15</div>And nothing, still shows.
Anyone can help me?
Thanks in advance,