jquery - Message compose area overflow on message content and change width when position:fixed; in html/css/javascript -
in messenger, message compose area overflow on message content , change width size when position:fixed; like:-
and when remove position:fixed; need scroll compose area e.g comes in bottom of page.
i need 1 fit in on bottom of screen , it's width same message reception area,
html
<div class="container bootstrap snippet"> <div class="tile tile-alt" id="messages-main"> <div class="ms-menu"> <div class="ms-user clearfix"> <img src="http://bootdey.com/img/content/avatar/avatar1.png" alt="" class="img-avatar pull-left"> <div>signed in <br> m-hollaway@gmail.com</div> </div> <div class="list-group lg-alt" id="scrollcontact"> <a class="list-group-item media" href=""> <div class="pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar2.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">davil parnell</div> </div> </a> <a class="list-group-item media" href=""> <div class="pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar3.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">ann watkinson</div> </div> </a> <a class="list-group-item media" href=""> <div class="pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar4.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">marse walter</div> </div> </a> <a class="list-group-item media" href=""> <div class="lv-avatar pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar5.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">jeremy robbins</div> </div> </a> <a class="list-group-item media" href=""> <div class="lv-avatar pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar6.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">reginald horace</div> </div> </a> <a class="list-group-item media" href=""> <div class="pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar7.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">shark henry</div> </div> </a> <a class="list-group-item media" href=""> <div class="pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar1.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">paul van dack</div> </div> </a> <a class="list-group-item media" href=""> <div class="lv-avatar pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar2.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">james anderson</div> </div> </a> <a class="list-group-item media" href=""> <div class="lv-avatar pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar2.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">james anderson</div> </div> </a> <a class="list-group-item media" href=""> <div class="lv-avatar pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar2.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">james anderson</div> </div> </a> <a class="list-group-item media" href=""> <div class="lv-avatar pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar2.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">james anderson</div> </div> </a> <a class="list-group-item media" href=""> <div class="lv-avatar pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar3.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="list-group-item-heading">kane williams</div> </div> </a> </div> </div> <div class="ms-body"> <div class="action-header clearfix"> <div class="visible-xs" id="ms-menu-trigger"> <i class="fa fa-bars"></i> </div> <div class="pull-left hidden-xs"> <img src="http://bootdey.com/img/content/avatar/avatar2.png" alt="" class="img-avatar m-r-10"> <div class="lv-avatar pull-left"> </div> <span>david parbell</span> </div> <ul class="ah-actions actions"> <li class="dropdown"> <a href="" data-toggle="dropdown" aria-expanded="true"> <i class="fa fa-sort"></i> </a> <ul class="dropdown-menu dropdown-menu-right"> <li> <a href="">latest</a> </li> <li> <a href="">oldest</a> </li> </ul> </li> <li class="dropdown"> <a href="" data-toggle="dropdown" aria-expanded="true"> <i class="fa fa-bars"></i> </a> <ul class="dropdown-menu dropdown-menu-right"> <li> <a href="">delete</a> </li> <li> <a href="">block messages</a> </li> <li> <a href="">report spam</a> </li> </ul> </li> </ul> </div> <div id="scrollmessage"> <div class="load-messages"> <a href="javascript:void(0);" class="btn btn-default">load more messages</a> </div> <div class="message-feed media"> <div class="pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar1.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="mf-content"> quisque consequat arcu eget odio cursus, ut tempor arcu vestibulum. etiam ex arcu, porta urna non, lacinia pellentesque orci. proin semper sagittis erat, eget condimentum sapien viverra et. mauris volutpat magna nibh, et condimentum est rutrum a. nunc sed turpis mi. in eu massa sem pulvinar lobortis. </div> <small class="mf-date"><i class="fa fa-clock-o"></i> 20/02/2015 @ 09:00</small> </div> </div> <div class="message-feed right"> <div class="pull-right"> <img src="http://bootdey.com/img/content/avatar/avatar2.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="mf-content"> mauris volutpat magna nibh, et condimentum est rutrum a. nunc sed turpis mi. in eu massa sem pulvinar lobortis. </div> <small class="mf-date"><i class="fa fa-clock-o"></i> 20/02/2015 @ 09:30</small> </div> </div> <div class="message-feed media"> <div class="pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar1.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="mf-content"> etiam ex arcumentum </div> <small class="mf-date"><i class="fa fa-clock-o"></i> 20/02/2015 @ 09:33</small> </div> </div> <div class="message-feed right"> <div class="pull-right"> <img src="http://bootdey.com/img/content/avatar/avatar2.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="mf-content"> etiam nec facilisis lacus. nulla imperdiet augue ullamcorper dui ullamcorper, eu laoreet sem consectetur. aenean et ligula risus. praesent sed posuere sem. cum sociis natoque penatibus et magnis dis parturient montes, </div> <small class="mf-date"><i class="fa fa-clock-o"></i> 20/02/2015 @ 10:10</small> </div> </div> <div class="message-feed media"> <div class="pull-left"> <img src="http://bootdey.com/img/content/avatar/avatar1.png" alt="" class="img-avatar"> </div> <div class="media-body"> <div class="mf-content"> cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. etiam ac tortor ut elit sodales varius. mauris id ipsum id mauris malesuada tincidunt. vestibulum elit massa, pulvinar @ sapien sed, luctus vestibulum eros. etiam finibus tristique ante, vitae rhoncus sapien volutpat eget </div> <small class="mf-date"><i class="fa fa-clock-o"></i> 20/02/2015 @ 10:24</small> </div> </div> </div> <div class="msb-reply"> <div class="row"> <div class="col-xs-12 mg-btm-10"> <textarea placeholder="what's on mind..."></textarea> <button id="button3" title="send"><i class="fa fa-paper-plane-o"></i></button> </div> <div class="col-xs-8"> <button id="button1" title="add file's"><i class="fa fa-file"></i></button> <button id="button2" title="add photo's"><i class="fa fa-camera"></i></button> </div> </div> </div> </div> </div> </div>
css
body { font-family: roboto,sans-serif; font-size: 13px; line-height: 1.42857143; color: #767676; background-color: #edecec; width:100%; height:100%; } .container{ width:100%; height:100%; } #scrollcontact { height: 500px; overflow-y: auto; overflow-x: hidden; background-color:#eee; } #scrollmessage { height: 500px; overflow-y: auto; overflow-x: hidden; } #messages-main { position: relative; margin: 0 auto; } #messages-main:after, #messages-main:before { content: " "; display: table; } #messages-main .ms-menu { position: absolute; left: 0; top: 0; border-right: 1px solid #eee; padding-bottom: 50px; height: 100%; width: 240px; } @media (min-width:768px) { #messages-main .ms-body { padding-left: 240px; } }@media (max-width:767px) { #messages-main .ms-menu { height: calc(100% - 58px); display: none; z-index: 1; top: 58px; } #messages-main .ms-menu.toggled { display: block; } #messages-main .ms-body { overflow: hidden; } } #messages-main .ms-user { padding: 15px; background: #f8f8f8; } #messages-main .ms-user>div { overflow: hidden; padding: 10px 5px 0 15px; font-size: 11px; } #messages-main #ms-compose { position: fixed; bottom: 120px; z-index: 1; right: 30px; box-shadow: 0 0 4px rgba(0, 0, 0, .14), 0 4px 8px rgba(0, 0, 0, .28); } #ms-menu-trigger { user-select: none; position: absolute; left: 0; top: 0; width: 50px; height: 100%; padding-right: 10px; padding-top: 19px; } #ms-menu-trigger { font-size: 21px; } #ms-menu-trigger.toggled i:before { content: '\f2ea' } .fc-toolbar:before, .login-content:after { content: "" } .message-feed { padding: 20px; } #footer, .fc-toolbar .ui-button, .fileinput .thumbnail, .four-zero, .four-zero footer>a, .ie-warning, .login-content, .login-navigation, .pt-inner, .pt-inner .pti-footer>a { text-align: center; } .message-feed.right>.pull-right { margin-left: 15px; } .message-feed:not(.right) .mf-content { background: #03a9f4; color: #fff; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12); } .message-feed.right .mf-content { background: #eee; } .mf-content { padding: 12px 17px 13px; border-radius: 2px; display: inline-block; max-width: 80%; } .mf-date { display: block; color: #b3b3b3; margin-top: 7px; } .mf-date>i { font-size: 14px; line-height: 100%; position: relative; top: 1px; } .msb-reply { position: fixed; bottom: 0px; background: #f8f8f8; padding: 10px 0; border-top: 1px solid #eee; } .four-zero, .lc-block { box-shadow: 0 1px 11px rgba(0, 0, 0, .27); } .msb-reply textarea { width: 100%; font-size: 13px; border: 0; padding: 10px 15px; resize: none; height: 60px; background: 0 0; } #button1 { position: relative; top: 0; right: 0; border: 0; height: 100%; width: 40px; font-size: 20px; color: #2196f3; background: 0 0; } #button2 { position: relative; top: 0; right: 0; border: 0; height: 100%; width: 40px; font-size: 20px; color: #2196f3; background: 0 0; } #button3 { position: absolute; top: 0; right: 0; border: 0; height: 100%; width: 60px; font-size: 25px; color: #2196f3; background: 0 0; } #button3:hover { background: #f2f2f2; } .img-avatar { height: 37px; border-radius: 2px; width: 37px; } .list-group.lg-alt .list-group-item { border: 0; } .p-15 { padding: 15px!important; } .btn:not(.btn-alt) { border: 0; } .action-header { position: relative; background: #f8f8f8; padding: 15px 13px 15px 17px; } .ah-actions { z-index: 3; float: right; margin-top: 7px; position: relative; } .actions { list-style: none; padding: 0; margin: 0; } .actions>li { display: inline-block; } .actions:not(.a-alt)>li>a>i { color: #939393; } .actions>li>a>i { font-size: 20px; } .actions>li>a { display: block; padding: 0 10px; } .ms-body{ background:#fff; } #ms-menu-trigger { user-select: none; position: absolute; left: 0; top: 0; width: 50px; height: 100%; padding-right: 10px; padding-top: 19px; cursor:pointer; } #ms-menu-trigger, .message-feed.right { text-align: right; } #ms-menu-trigger, .toggle-switch { -webkit-user-select: none; -moz-user-select: none; } .load-messages{ text-align:center; margin-top:10px; } .btn{ background:#eee; }
jsfiddle:- https://jsfiddle.net/fwmuycyf/
Comments
Post a Comment