M
M
Maxim Morozov2019-08-17 16:00:59
JavaScript
Maxim Morozov, 2019-08-17 16:00:59

How to call an online chat or a callback in Bitrix24 with a separate button?

Site on 1C-Bitrix, the site has a widget with Bitrix24 CRM. It is required to display a separate button, when clicked, an online chat will open.
I already found a seemingly ready-made solution, but it doesn’t want to work, or I’m doing something wrong ...
We have a script:

<script>
$('.livechat_mobile').on('click', function(){ //вешаем событие click на нашу кнопку обратного звонка
$('.b24-widget-button-openline_livechat span').trigger('click'); //запускаем событие click на кнопке обратного звонка в виджете чата Вitrix24
});
</script>

The script was written before the closing body tag in the footer of the site.
On the site it came out like this:
<a class="livechat_mobile btn btn-default">Онлайн чат</a>

But alas, nothing worked. I tried to display it as an ID while writing in the script like this: $ ('# livechat_mobile')
Can someone tell me how to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wsu, 2019-09-06
@wsu

Your example works.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question