я сделал такую вот небольшую ленту с двумя пользователями: html
<div class="msg_block">
<div class="users_msg_block">
<a data-triger="user1" class="new_msg_user"><img src="/images/icons/users/consultation_filled-32.png" alt="" title="" /></a>
<a data-triger="user2" class="new_msg_user"><img src="/images/icons/users/consultation_filled-32.png" alt="" title="" /></a>
</div>
<div class="msg_bnt_active">
<a><i class="fa fa-comments-o"></i></a>
</div>
</div>
css:
.msg_block {
background-color: #ffab3b;
position: fixed;
bottom: 10px;
left: 10px;
z-index: 9999999;
width: 50px;
border-radius: 30px;
}
.users_msg_block {
display: inline-grid;
margin-bottom: 10px;
}
.new_msg_user {
height: 50px;
width: 50px;
border-radius: 50%;
background-color: #fe980f;
border: 1px solid #ffab3b;
padding: 9px;
color: white;
margin-bottom: 5px;
}
.msg_bnt_active {
height: 50px;
width: 50px;
border-radius: 50%;
background-color: #fe980f;
border: 1px solid #ffab3b;
}
.msg_bnt_active a {
color: white;
padding: 10px;
font-size: 30px;
}
теперь вопрос в том как сделать чтоб при клике на юзера открывался блок диалога с этим юзером, а при нажатии на msg_bnt_active показывался и скрывался список этих пользователей
блок который будет открываться и закрываться вот:
<div class="msg_box">
<div class="msg_box_header">
<div><h5>User 1</h5></div>
<div><a><i class="fa fa-times"></i></a></div>
</div>
<div class="msg_box_wrapper">
dialog...
</div>
<div class="msg_box_footer">
<input type="text" name="send_message" />
</div>
</div>
для каждого пользователя должен открываться свой блок с диалогом
Ну прям точь в точь я ни делал но похоже
* {
margin: 0;
padding: 0;
text-decoration: none;
}
.panel {
border: 1px solid #ccc;
display: block;
border-radius: 10px;
background: #fbfbfb;
width: 50vw;
margin: 20px auto;
}
.top__panel {
padding: 10px;
display: flex;
justify-content: space-between;
align-items: center;
background: #ccc;
}
span.trigger {
font-size: 2em;
margin-left: 20px;
padding: 0 10px;
margin-top: -5px;
}
.top__panel p a {
color: red;
}
.user {
display: flex;
padding: 10px;
}
.user div {
display: flex;
flex-direction: column;
justify-content: center;
padding: 0 10px;
}
.message {
width: 95%;
margin: auto;
padding: 10px;
}
.message i {
color: lightblue;
}
.message textarea {
width: 100%;
min-height: 20vh;
}
.message div {
display: flex;
justify-content: space-between;
align-items: center;
height: 30px;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="panel">
<div class="top__panel">
<span>Новое сообщение</span>
<a href="#">Перейти к диалогу с USER</a>
<span class="trigger">x</span>
</div>
<div class="user">
<img src="http://placehold.it/100" alt="" width="100px" height="100px" style="border-radius:50%;">
<div>
<p>Имя Фамилия</p>
<p>онлайн <i class="fa fa-phone"></i> </p>
</div>
</div>
<div class="message">
<form action="">
<textarea name=""></textarea>
<div>
<p>
<a href=""><i class="fa fa-picture-o"></i> </a>
<a href=""><i class="fa fa-camera"></i> </a>
<a href=""><i class="fa fa-music"></i> </a>
</p>
<button class="btn">Отправить</button>
</div>
</form>
</div>
</div>
Апостиль в Лос-Анджелесе без лишних нервов и бумажной волокиты
Основные этапы разработки сайта для стоматологической клиники
Продвижение своими сайтами как стратегия роста и независимости