0

我有两个div。一个有边框,图像大小相同。

  • 当我有图像(推文图像,未旋转)时,它可以工作。

  • 当我移动旋转的图像(小丑图像)时,div 移动不需要(开始拖动)

  • 图像不在同一位置。

如何用 css/jquery 解决这个问题?

// putting images on screan
$("#img1").css({"top": "200px", "left": "100px"});
$("#img1").myrotate();
$("#img2").css({"top": "100px", "left": "300px"});
$("#img2").myrotate(); 

// rotating image 2 
rotateMe($("#img2"), 45);
rotateMe(selectedDiv, 45);



// here is the problem
div.draggable({
     drag: function() {
          id = $(this).attr("id").substring(3);    
          var pos = $(this).position();
          $("#" + id).css({"top": pos.top + "px", "left": pos.left + "px"});
     }
});

在这里摆弄

4

0 回答 0