문제

Well basically I have a container that I want to be able to sort all the divs inside of it :

<div class="container">
    <div id ="sortable" class="row ui-sortable">
    <div class="boxEncar">
        <div class="col-md-4">
            <?php zone_print("middle1") ; ?>
        </div>
        <div class="col-md-4">
            <?php zone_print("middle2") ; ?>
        </div>
        <div class="col-md-4">
            <?php zone_print("middle3") ; ?>
        </div>
    </div>
    </div>
</div>

And here's my call to sortable class:

jQuery(document).ready(function() {
    jQuery('#sortable').sortable();
}); 

The issue here is that the whole container get sortable while i just need col-md-4 to be so! Any way I can achieve this? Thanks.

도움이 되었습니까?

해결책

You have to select the parent of the sortable items!

jQuery('#sortable > .boxEncar').sortable();

다른 팁

Try to use:

jQuery('#sortable').find('.col-md-4').sortable();

instead of:

jQuery('#sortable').sortable();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top