我意識到我在Chrome中存在jQuery Draggable的bug,這在Firefox和Internet Explorer中不存在。裏面有div#drag-container/450x80 /和3個可拖動的對象。/150x0 /當我將它們移動到最低點時,讓它們再次拖動LOWER,它們會獲得位置0,80 + 14 = 0.94 px。我讓他們拖動,他們再次降低了14倍。jQuery Draggable - 走出遏制 - Chrome Bug
是否有修復?
工作演示:http://jsfiddle.net/ucmqq/ 這裏是代碼:
<style>
.draggable { width: 150px; height: 0px; cursor:move; }
<?PHP if($userinfo->use_colors != '0'): ?>
#drag-container { width: 450px; height:80px; background-color:<?=$userinfo->background?>; }
<?PHP else: ?>
#drag-container { width: 450px; height:80px; background:url(/backgrounds/<?=$userinfo->image?>); }
<?PHP endif; ?>
</style>
<script language="javascript">
$(function() {
$("#draggable").draggable({ cursor: "move",containment: 'parent', scroll: false,
stop: function() {
document.settings.np_x.value = $(this).css('left');
document.settings.np_y.value = $(this).css('top');
}
});
$("#draggable2").draggable({ cursor: "move",containment: 'parent', scroll: false ,
stop: function() {
document.settings.artist_x.value = $(this).css('left');
document.settings.artist_y.value = $(this).css('top');
}
});
$("#draggable3").draggable({ cursor: "move",containment: 'parent', scroll: false ,
stop: function() {
document.settings.other_x.value = $(this).css('left');
document.settings.other_y.value = $(this).css('top');
}
});
});
</script>
<div id="drag-container">
<div id="draggable" class="draggable" style="position:relative;top:5px;left:80px;">
.::[ NowPlaying SIGnature ]::.
</div>
<div id="draggable2" class="draggable" style="position:relative;top:25px;left:80px;">
Artist - title
</div>
<div id="draggable3" class="draggable" style="position:relative;top:45px;left:80px;">
Album: (Year)
<br>
Genre:
</div>
</div>