I
I
Ilya Derevyannykh2020-06-04 19:52:34
css
Ilya Derevyannykh, 2020-06-04 19:52:34

How to hide jivosite in mobile version?

I tried different codes, but it does not work, tell me how to make it work. Site on WP+Avada

$(window).resize(function() {
    width = $(window).width();
    if (width >= 991) {
        //ваши скрипты
    }
});
<script type="text/javascript">

    if (screen.width > 480) document.write ('
      <script type="text/javascript" src="js/wow.min.js" ></sc' + 'ript>
   ');

</script>
// делаете переменную в начале кода
var isMobile = false;
// проверка на размер экрана (размер я брал вроде с Bootstrap-а)
$(document).ready( function() {
    if ($('body').width() <= 400) {
        isMobile = true;
    }
    // и потом если нужен код только для телефона:
    if (isMobile) {
        ...
    }
    // или для остальных
    if (!isMobile) {
        ...
    }
} );

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
KingAnton, 2020-06-04
@Ylia_dr

<?php if(wp_is_mobile()) : ?>
jivosite code
<?php endif; ?>

Y
yarnstart, 2020-06-05
@yarnstart

In jivosite's personal account in the settings, such a function should be out of the box

N
Nadim Zakirov, 2020-06-05
@zkrvndm

Place the following html code on your site (anywhere):

<script type="text/javascript">
  document.addEventListener('DOMContentLoaded', function() {
    if (window.innerWidth > 768) {
      var jivo = 'Здесь разместите код от виджета JivoSite';
      document.body.insertAdjacentHTML('beforeEnd', jivo);
    }
  });
</script>

Inside the single brackets, place the code from the JivoSite widget, BUT without line breaks inside!
Remove all line breaks from the widget code beforehand!!! Otherwise there will be an error and will not work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question