如果div是固定的,则显示完整内容

时间:2016-09-25 11:27:43

标签: javascript jquery html css

这里我有两个长for (var i = 0; i < log.length; i++) { logWindow.document.getElementsByTagName("body")[0].appendChild(log[i]) } 个。第一个div已修复,我希望在用户滚动时显示div的所有元素(因为我在第一个div.content上有完整元素。 我怎么能这样做?

div

1 个答案:

答案 0 :(得分:1)

请检查一下。我想在你固定内容块中你必须添加一些高度然后给出溢出滚动。

<div style="display: block; width: 100%;">

    <div style="float: left; position: relative; z-index: 0;">
        <div style="position: relative;">
            <div class="content" style="padding-top: 10px; top: 10px; position: fixed;overflow-y: scroll;height: 186px;">

                <div style="margin-top: 10px;">MENU</div>
                <div style="margin-top: 10px;">MENU</div>
                <div style="margin-top: 10px;">MENU</div>
                <div style="margin-top: 10px;">MENU</div>
                <div style="margin-top: 10px;">MENU</div>
                <div style="margin-top: 10px;">MENU</div>
                <div style="margin-top: 10px;">MENU</div>
                <div style="margin-top: 10px;">MENU</div>
                <div style="margin-top: 10px;">MENU</div>
                <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
            <div style="margin-top: 10px;">MENU</div>
                Show element after user scrolls

            </div>
        </div>
    </div>

    <div style="float: left; margin-left: 11%; width: 67%;">

        Right DIV FUll LONG TEXT

    </div>