2013-08-18 79 views
0

我想讓佔位符jQuery排序。我得到這個代碼jQuery可排序佔位符水平divs

$('#list').sortable({ 
    placeholder: "testclass", 
    forcePlaceholderSize: true 
}); 
<div id="list"> 
    <div class="item">First</div> 
    <div class="item">Second</div> 
    <div class="item">Third</div> 
</div> 
.item { 
    border: 1px solid black; 
    padding: 2px 4px; 
    display: inline-block; 
} 
.testclass { 
    background-color: red; 
    border: 2px solid red; 
} 

http://jsfiddle.net/EUVrK/81/

但它不似乎運作良好

回答

0

嘗試使佔位符inline-block的

.testclass { 
    background-color: red; 
    border: 2px solid red; 
    width: inherited; 
    display: inline-block; 
} 

演示:Fiddle

+0

這有點「跳躍」,但謝謝:) – dontHaveName