Boostrap dynamic div position

妖精的绣舞 提交于 2021-01-29 03:12:31

问题


i need yout help.

i've two parent div,

<div class="container-fluid" >
 <div class="row-fluid" id="id">

in these div I put other div created by an ajax call.

I created a div which will then be populated with data. the div is:

       <div class="col-sm-3 col-md-5 space">
            <h2 style="color:#900000">###</h2>
            <p class="lead">###
            <p>
            <p style="text-align: right"><i class="fa fa-clock-o"></i>12/5/24</p>
            <div class="thumbnail">
                <img src="">
            </div>

            <div class="caption">
                <p>Differetn lenght of data  -<<< PROBLEM IS HERE
                   text.</p>


                <a href=download="sss" class="padd">Allegato: ssss'</a>
                <br>
            </div>
        </div>

The ajax call make 5 div Of these with a different length.

EDIT OF masonry


回答1:


Use this masonry plugin

HTML

<div class="container masonry">
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick large"></div>
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick small"></div>
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick small"></div>
    <div class="block masonry-brick small"></div>
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick large"></div>
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick large"></div>
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick small"></div>
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick small"></div>
    <div class="block masonry-brick small"></div>
    <div class="block masonry-brick medium"></div>
    <div class="block masonry-brick large"></div>
</div>

JS

$('.container').masonry({
    // options
    itemSelector : '.block',

});

For demo



来源:https://stackoverflow.com/questions/39054644/boostrap-dynamic-div-position

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!