我正在使用jquery来拖拽图像。下面是我的代码
$( "#imgMaster" ). draggable
({
axis: "y",
containment:[0,170,0,430],
start: function(event, ui)
{
$("#imgFrontLeft").trigger('draggable');
}
});
$( "#imgFrontLeft" ). draggable
({
axis: "y" ,
containment:[0,162,0,290],
});我的要求是,在拖动#imgMaster时,必须拖动#imgFrontLeft。这两个图像都是独立拖动的。请帮助我,我怎样才能满足我的要求。
发布于 2013-02-11 18:46:14
看一下这个Fiddle链接,它将帮助你获得同步两个图像以进行拖动的答案。你可以使用这个
$("#imgFrontLeft").css('left',ui.position.left);
$("#imgFrontLeft").css('top',ui.position.top); 在你的代码中拖动图像,我希望这会对你有更多的帮助。
https://stackoverflow.com/questions/14809283
复制相似问题