【问题标题】:Main vertical scroll affects the scroll in a fixed div主垂直滚动影响固定 div 中的滚动
【发布时间】:2015-06-30 21:10:00
【问题描述】:

我需要一个带有overflow-y并固定在页面底部的基本容器。
我的问题是页面的主滚动影响了容器滚动。
当主滚动条位于顶部时,聊天滚动条工作正常,但当它位于底部时,聊天滚动条无法正常运行。

我的代码中的错误在哪里?

<style>
.floatChat{
    position: fixed;
    bottom: 30px;
    left: 95px;
    z-index: 1001;      
    height: 250px;           
    font-size: 12px;    
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;}
</style>

<div id="chatPanel"> <div class="floatChat">
         <div id="chat" class="col-md-3">
            <div class="panel panel-primary" style="width:250px;">
            <div class="panel-heading" style="height:30px; font-size:12px; border-color:#069;">
                <div class="panel-actions" style="height:30px;">
                    <div class="btn-group">                                          
                    <i class="fa fa-pencil btn" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Practise"></i>
                    <i class="fa fa-times btn" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Close" onclick="removeChatBox(index);"></i>
                    </div>                                                         
                </div>
                <div class="text-bold"><i class="fa fa-comments"></i> friendName </div>                                               
            </div>
            <div class="panel-body bg-inverse" style="height:210px;">
                <div style="height:190px; width:230px;">
                    <div id="mesContainer" style="overflow-x:hidden; overflow-y:auto; height:170px; word-wrap: break-word;">                                            
                    </div>
                </div>
            </div>
            <div class="panel-footer" style="padding:0px;">
                <div class="input-group input-group-in">
                    <input id="mes" type="text" class="form-control input-sm">
                    <span class="input-group-btn">
                        <button id="send" class="btn btn-primary" type="button" onclick="sendChatMessage(friendId)";><i class="fa fa-share text-midnight"></i></button>
                    </span>
                </div>                 
            </div>
            </div>
        </div>
    </div></div>

MesContainer 是消息的容器。

【问题讨论】:

标签: html css twitter-bootstrap


【解决方案1】:

发现我有一个样式文件

-webkit-transform: translateZ(0);

在类中定义。

这解决了整个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-12-27
    相关资源
    最近更新 更多