Avraam Mavridis
Avraam Mavridis

Reputation: 8920

How to make a div scrollable when it overflows by adding children

I have the following div:

<div class="container-fluid">
    <div class="row-fluid">
        <div class="col-md-4 ticker">

        </div>
    </div>
</div>
<button onclick="lol()">sdas</button>

I append children to that by jQuery.

<script>
function lol()  {

    $( ".ticker" ).append( "<p>dsadsa</p>" );
}
</script>

I want when the are more children than can fit on the div max-height the div to become scrollable, any help how can I achieve that?

http://jsfiddle.net/#&togetherjs=RuintOf6bR

Upvotes: 0

Views: 52

Answers (1)

Timur
Timur

Reputation: 639

.ticker{
    height: 700px;
    max-height: 700px;
    background-color: red;
    overflow-y: scroll;
}

Upvotes: 2

Related Questions