HI全部。 我正在使用下面的代碼來旋轉拖放/丟棄的圖像。旋轉工作正常,但是當我開始旋轉時,圖像移動到「div」容器外。任何我想念的東西。jquery包含圖像旋轉的問題
//Moving outside the container for first time.After dragging inside the div,then rotates inside the div
var test = 5;
var mouseDown = false;
$(function() {
$('.frame').mousedown(function(e) { mouseDown = true; });
$('.frame').mouseup(function(e) { mouseDown = false; });
$('.frame .rotatable').live('mousemove', function(e) {
if ((mouseDown) && (e.ctrlKey)) {
test = test + 10;
var currentId;
document.getElementById('angle').value = test;
$(this).rotate({ angle: test });
var currentId = $(this).attr('id');
var id = currentId.substring(8);
var deleteimage = 0;
var angle = test;
saveCoords(e.clientX, e.clientY, angle, id, document.getElementById("<%=trafficID.ClientID%>").value, deleteimage);
}
$('#frame .rotatable').draggable({ containment: 'parent' });
});
});
HTML
<div id="frame" class="frame" runat="server" style="width:550px; height:400px;background-position:bottom; border:1px solid #000;">
謝謝,
旋轉和DIV範圍工作很奇怪,它在我找到的瀏覽器之間有所不同。 – Orbling 2011-02-09 16:50:35
@Orling我正在使用IE – Vani 2011-02-09 17:03:03