Привет. Клик по блоку закрывает его и при условии, что он находится сверху другого блока, меняется цвет.
var bodyChat = document.querySelector('.form-body');
$('.float-chat').on('click', function (e) {
bodyChat.classList.toggle('show');
if (icms.chat.elementIsVis('.icms-footer__middle')) {
if (float_chat.style.color != "") {
float_chat.style = ""
} else {
float_chat.style.backgroundColor = '#ecccbd';
float_chat.style.color = '#1c223e';
}
}
});
Код:
|
<style>
.form-body {
position: relative;
width:100%;
height:100%;
margin-bottom:-300px;
transition: margin 0.5s linear;
}
</style> |
Как сделать, что бы цвет менялся после завершения toggle()? То есть, после того, как блок закроется, а не во время клика.