"Like Hangout Chat"
Bootstrap 3.1.0 Snippet by SrPatinhas

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="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.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 class="row chat-window col-xs-5 col-md-3" id="chat_window_1" style="margin-left:10px;">
<div class="col-xs-12 col-md-12">
<div class="panel panel-default">
<div class="panel-heading top-bar">
<div class="col-md-8 col-xs-8">
<h3 class="panel-title"><span class="glyphicon glyphicon-comment"></span> Chat - Miguel</h3>
</div>
<div class="col-md-4 col-xs-4" style="text-align: right;">
<a href="#"><span id="minim_chat_window" class="glyphicon glyphicon-minus icon_minim"></span></a>
<a href="#"><span class="glyphicon glyphicon-remove icon_close" data-id="chat_window_1"></span></a>
</div>
</div>
<div class="panel-body msg_container_base">
<div class="row msg_container base_sent">
<div class="col-md-10 col-xs-10">
<div class="messages msg_sent">
<p>that mongodb thing looks good, huh?
tiny master db, and huge document store</p>
<time datetime="2009-11-13T20:00">Timothy • 51 min</time>
</div>
</div>
<div class="col-md-2 col-xs-2 avatar">
<img src="http://www.bitrebels.com/wp-content/uploads/2011/02/Original-Facebook-Geek-Profile-Avatar-1.jpg" class=" img-responsive ">
</div>
</div>
<div class="row msg_container base_receive">
<div class="col-md-2 col-xs-2 avatar">
<img src="http://www.bitrebels.com/wp-content/uploads/2011/02/Original-Facebook-Geek-Profile-Avatar-1.jpg" class=" img-responsive ">
</div>
<div class="col-md-10 col-xs-10">
<div class="messages msg_receive">
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
body{
height:400px;
position: fixed;
bottom: 0;
}
.col-md-2, .col-md-10{
padding:0;
}
.panel{
margin-bottom: 0px;
}
.chat-window{
bottom:0;
position:fixed;
float:right;
margin-left:10px;
}
.chat-window > div > .panel{
border-radius: 5px 5px 0 0;
}
.icon_minim{
padding:2px 10px;
}
.msg_container_base{
background: #e5e5e5;
margin: 0;
padding: 0 10px 10px;
max-height:300px;
overflow-x:hidden;
}
.top-bar {
background: #666;
color: white;
padding: 10px;
position: relative;
overflow: hidden;
}
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
$(document).on('click', '.panel-heading span.icon_minim', function (e) {
var $this = $(this);
if (!$this.hasClass('panel-collapsed')) {
$this.parents('.panel').find('.panel-body').slideUp();
$this.addClass('panel-collapsed');
$this.removeClass('glyphicon-minus').addClass('glyphicon-plus');
} else {
$this.parents('.panel').find('.panel-body').slideDown();
$this.removeClass('panel-collapsed');
$this.removeClass('glyphicon-plus').addClass('glyphicon-minus');
}
});
$(document).on('focus', '.panel-footer input.chat_input', function (e) {
var $this = $(this);
if ($('#minim_chat_window').hasClass('panel-collapsed')) {
$this.parents('.panel').find('.panel-body').slideDown();
$('#minim_chat_window').removeClass('panel-collapsed');
$('#minim_chat_window').removeClass('glyphicon-plus').addClass('glyphicon-minus');
}
});
$(document).on('click', '#new_chat', function (e) {
var size = $( ".chat-window:last-child" ).css("margin-left");
size_total = parseInt(size) + 400;
alert(size_total);
var clone = $( "#chat_window_1" ).clone().appendTo( ".container" );
clone.css("margin-left", size_total);
});
$(document).on('click', '.icon_close', function (e) {
//$(this).parent().parent().parent().parent().remove();
$( "#chat_window_1" ).remove();
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

<html>

forpelindo () - 5 years ago - Reply 0


i have not working

runo200 () - 5 years ago - Reply 0


awesome

Tegars Swasono () - 7 years ago - Reply 0


wow, good job overwriting core classes making this useless

Tony () - 7 years ago - Reply 0


Nice

Alexander Bondarenco () - 8 years ago - Reply 0


How can i make it responsive ?

Kiee () - 8 years ago - Reply 0


I want to close the box by default how to do this please suggest me

Dheeraj Mishra () - 9 years ago - Reply 0


Hi, I can't get the minus to work properly...

Ben Ng () - 9 years ago - Reply 0


thank you so much this is amazing. html, css, is so simple and easy to use...and it looks slick as hell

aaa28 () - 9 years ago - Reply 0


great work man love it! :)

Peter Phillip () - 9 years ago - Reply 0


it's totally useless and gotta be deleted from bootsnipp. this is the worst snippet that I ever seen on this website. Sad but true.

Name () - 10 years ago - Reply 0


lmao please back up your answer :/

Peter Phillip () - 9 years ago - Reply 0


Please advise on how to auto scroll to the last post when hitting submit. Thanks in advance.

Pierre Ferreira () - 10 years ago - Reply 0


I am also looking for this..

Adam Looze () - 10 years ago - Reply -1


$('.msg_container_base').scrollTop($('.msg_container_base')[0].scrollHeight);

Andrew Kim () - 9 years ago - Reply 0


Suuuuperb (clap)

Chakravarthy Karri () - 10 years ago - Reply 0


Tem como ele já vim fechado ?

gleryston matos () - 10 years ago - Reply 0


Da uma olhada no Link-> view-source:http://bootsnipp.com/iframe...

Font da pagina, Copia e cola na pagina.

Dionésio Guerra () - 9 years ago - Reply 0


Very Good Tutorial

chandrakanth_balaraman () - 10 years ago - Reply 0