"Chat"
Bootstrap 3.3.0 Snippet by lippo97

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div id="chats" class="container">
<div class="chat-window col-xs-5 col-md-3" id="chat_window_1">
<div class="chat-header col-xs-12">
<div class="col-xs-8">
<span class="glyphicon glyphicon-comment"></span><span class="username"> Mario</span>
</div>
<div class="col-xs-4 text-right">
<a><span class="glyphicon glyphicon-minus icon_minim"></span></a>
<a><span class="glyphicon glyphicon-remove icon_close" data-id="chat_window_1"></span></a>
</div>
</div>
<div class="toHide">
<div class="chat-body">
<div class="row msg msg-sent">
<div class="col-xs-10">
<div class="msg-text">
<p>Some, beautiful text</p>
</div>
</div>
<div class="col-xs-2">
<div class="profile-pic">
<img class="img-responsive img-rounded" src="http://www.bitrebels.com/wp-content/uploads/2011/02/Original-Facebook-Geek-Profile-Avatar-1.jpg">
</div>
</div>
</div>
<div class="row msg msg-sent">
<div class="col-xs-10">
<div class="msg-text">
<p>Some, beautiful, long looooooooooooooooooooooooooooooooooooooooooooooooooooooong text</p>
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
html,
body{
height: 100%;
}
#chats{
position: fixed;
bottom: 0;
width: 100%;
background: red;
height: 400px;
}
#chats .chat-window{
position: relative;
height: 100%;
padding: 0;
}
#chats .chat-header{
position: absolute;
top: 0;
padding: 15px;
width: 100%;
height: 50px;
background: #2F2F2F;
color: white;
font-weight: bold;
border-radius: 5px 5px 0 0;
}
#chats .chat-header a{
text-decoration: none;
cursor: pointer;
color: white;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$( document ).ready(function(){
$(".icon_close").click(function(){
$( this ).closest(".chat-window").remove();
});
});
$(document).on('click', '.icon_minim', function (e) {
var toHide = $( this ).closest(".chat-window").find(".chat-body");
if (toHide.hasClass("panel-hidden")){
toHide.removeClass("panel-hidden");
toHide.slideUp();
}else{
toHide.addClass("panel-hidden");
toHide.slideDown();
}
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: