Author Topic: решено: плавающая кнопка - solved: floating button  (Read 5484 times)

0 Members and 1 Guest are viewing this topic.

PretorianetZ

  • Jr. Member
  • **
  • Posts: 4
Кривоватое но рабочее решение плавающей кнопки чата

как выглядит - http://автопропуска.рф/полис_ОСАГО/index.html (пока тут тестится)

как работает, посетитель заходит и видит плавающую кнопку чата (которую выбрали в настройках)


<script>
var show;
function hidetxt(type){
param=document.getElementById(type);
if(param.style.display == "none") {
if(show) show.style.display = "none";
param.style.display = "block";
show = param;
}else param.style.display = "none"
}
</script>

скрипт скрывает слои при нажатии и разворачивает при повторном нажатии (но разворот кнопки не нужен), вместо нее уже будет чат или при нажатии свернуть "маленькое окно с конвертом"

<div id="mibew-agent-button" style="position: fixed; bottom: 5px; right: 55px; opacity: 1;z-index: 201;">            

<a id="mibew-agent-button" href="/mibew/chat?locale=ru" target="_blank" onclick="Mibew.Objects.ChatPopups['ТУТ_ВАШ_КОД_ЧАТА'].open();return false;">

<img src="/mibew/b?i=mblue&amp;lang=ru" border="0" onClick="hidetxt('mibew-agent-button'); return false;" alt="чат" /></a>

<script type="text/javascript" src="/mibew/js/compiled/chat_popup.js"></script>

на картинку поставлено событие OnClick - скрыть содержимое DIVa при нажатии на кнопку (картинку вызова чата)

<script type="text/javascript">Mibew.ChatPopup.init({"id":"ТУТ_ВАШ_КОД_ЧАТА","url":"\/mibew\/chat?locale=ru","preferIFrame":true,"modSecurity":false,"width":360,"height":500,"resizable":true,"styleLoader":"\/mibew\/chat\/style\/popup"});</script>
</div>            
 
пожалуйста не копируйте мой код кнопки - установлен русский язык и нет персонального кода чата, просто скопируйте первый жзва скрипт и установите свойства div и img

----------------------------------------------------------------------

in English

A curved but working solution of the floating chat button

how it works, the visitor comes in and sees the floating chat button (which was chosen in the settings)

the script hides the layers when pressed and unfolds when you press it again (but the button does not need a turn), instead of it there will already be a chat or if you click "minimize a small window with an envelope"

the OnClick event is put on the picture - hide the contents of DIVa when clicking on the button (the picture of the chat call)

PS - please do not copy my button code - Russian is installed and there is no personal chat code, just copy the first script and set the properties of div and img
« Last Edit: October 02, 2017, 11:26:56 AM by PretorianetZ »