堆叠两个瘦卷轴似乎不起作用

时间:2018-11-13 08:45:07

标签: javascript html css slimscroll

注释掉slimscroll初始化代码后,它应能正常工作-滚动条可见。当苗条滚动初始化时,它应该基本相同,除了本地滚动条应该是苗条滚动的滚动条,但是现在它破坏了一切。小提琴http://jsfiddle.net/xyvo4r0a/3

<div class="slimScroll" style="overflow-y:auto;height:200px;width:250px">
    <div class="child-height-1" style="height:50%;overflow-y:auto">
        <div class="child-content" style="height:300px;background-color:lightgreen">asd</div>
    </div>
    <div class="child-height-2" style="height:50%;overflow-y:auto">
        <div class="child-content" style="height:300px;background-color:lightyellow">asd</div>
    </div>
</div>

<script src="https://cdnjs.cloudflare.com/ajax/libs/slim-scroll/1.3.2/slimscroll.min.js"></script>
<script>
    $(function () {
        //new slimScroll($('.child-height-1')[0]);
        //new slimScroll($('.child-height-2')[0]);
    });
</script>

1 个答案:

答案 0 :(得分:1)

尝试一下:

<div class="child-height-1" style="height:50%; overflow: hidden; position: relative;">

提琴:http://jsfiddle.net/c8d3ohue/