我有一張桌子。在裏面我有一個叫做阻力的課。我需要拖動那個類。我應該如何拖動它?在表格內選擇一個班級進行拖動
//Counter
counter = 0;
//Make element draggable
$('.drag').draggable({
revert: 'invalid',
helper: 'clone',
containment: 'frame',
cursorAt: { left: -1, top: -1 },
//When first dragged
stop: function (ev, ui) {
//code here
}
});
下面是我的表格。我應該如何拖動桌子?
<div class="options">
<div>
<table id="gvEventDetails" cellspacing="0" border="1"
style="border-collapse:collapse;" rules="all">
<tbody>
<tr><th scope="col">EventID</th></tr>
<tr>
<td>
<div id="drag0" class="drag"
style="background-color:RGB(30,140,70)" height:32px;=""
width:32px;="" position:absolute;="">Event1
</div>
</td>
</tr>
<tr>
<td>
<div id="drag1" class="drag"
style="background-color:RGB(40,30,255)" height:32px;=""
width:32px;="" position:absolute;="">Event2
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
什麼問題,你用你的代碼有? – j08691 2012-07-16 15:09:36
你的代碼已經工作,請檢查http://jsfiddle.net/LJNtE/ – Adi 2012-07-16 15:10:20