"Like Hangout Chat"
Bootstrap 3.1.0 Snippet by kinjalpanchal

<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:70%;"> <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"> Help</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> <div class="panel-footer"> <div class="input-group"> <input id="btn-input" type="text" class="form-control input-sm chat_input" placeholder="Write your message here..." /> <span class="input-group-btn"> <button class="btn btn-primary btn-sm" id="btn-chat">Send</button> </span> </div> </div> </div> </div> </div>
.panel{ margin-bottom: 0px; } .chat-window{ bottom:0; position:fixed; float:left; margin-right:10px; } .chat-window > div > .panel{ border-radius: 5px 5px 0 0; } .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; } .msg_container { padding: 10px; overflow: hidden; display: flex; } .btn-group.dropup{ position:fixed; left:0px; bottom:0; }
$(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', '.icon_close', function (e) { //$(this).parent().parent().parent().parent().remove(); $( "#chat_window_1" ).remove(); });

Related: See More


Questions / Comments: