Hang Prond
Hang Prond

Reputation: 59

Sortablejs, drag-drop without other elements move

How is it possible that the elements did not move before element drops?

In this image, you can see how it is working

this is what I need

Source code:

var lgh = document.querySelectorAll('.list-group-header'), i=0;
for(i;i<lgh.length;i++){
    new Sortable(lgh[i], {
        group: 'stored',
        draggable: '.board-header-item',
        forceFallback: true,
        dragoverBubble: true,
        animation: 150  
    });
}
.sortable-ghost {background-color: white}
.sortable-fallback {transform: rotate(1deg);}
.sortable-fallback{cursor: pointer !important}
.list-group-header .sortable-ghost {background-color: white;color:black}
.list-group-header .sortable-fallback {transform: rotate(2deg);background: white}
.list-group-header .sortable-fallback {cursor: pointer !important}    
.board-header-item{display: inline-block;padding: 7px 10px;border: 1px solid black;text-align: center}
<script src="http://sortablejs.github.io/Sortable/Sortable.js"></script>
<div class="list-group-header">
    <div class="board-header-item status_size">
        <span class="second">Status</span>
    </div>
    <div class="board-header-item person_size">
        <span class="second">People</span>
    </div>
    <div class="board-header-item date_size">
        <span class="second">Date</span>
    </div>
    <div class="board-header-item timeline_size">
        <span class="second">Timeline</span>
    </div>    
</div>

Upvotes: 2

Views: 1475

Answers (1)

Hang Prond
Hang Prond

Reputation: 59

I found solution

swap: true, animation : 0

Guys , like me

if you don't know good English, this forum is not for you

here only professional English speakers, who know good asks, answers, ext.

if someone know answer on your questions, but you miss semicolon on sentence, they told you: lets go learn grammar and after come here for your question.

Good bye stack-overflow, thank you for helping me in the past. I will never post again, no help, no questions

Upvotes: 2

Related Questions