Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用jquery通过拖动其他图像触发图像拖动_Jquery_Jquery Ui_Jquery Draggable - Fatal编程技术网

如何使用jquery通过拖动其他图像触发图像拖动

如何使用jquery通过拖动其他图像触发图像拖动,jquery,jquery-ui,jquery-draggable,Jquery,Jquery Ui,Jquery Draggable,我正在使用jquery来拖动图像。 下面是我的代码 $( "#imgMaster" ). draggable ({ axis: "y", containment:[0,170,0,430], start: function(event, ui) { $("#imgFr

我正在使用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拖动时,必须拖动imgfrontfleft。 两个图像都是独立拖动的。 请帮助我,我如何才能满足我的要求。

查看此链接这将帮助您获得同步两个图像以进行拖动的答案。 你可以用这个

 $("#imgFrontLeft").css('left',ui.position.left); 
 $("#imgFrontLeft").css('top',ui.position.top); 
在您拖动图像的代码中,我希望这将对您有更多帮助。

查看此链接这将帮助您获得同步两个图像以进行拖动的答案。 你可以用这个

 $("#imgFrontLeft").css('left',ui.position.left); 
 $("#imgFrontLeft").css('top',ui.position.top); 

在您的代码中拖动图像,我希望这将对您有更多帮助。

他们的任何演示是否正常工作?演示是否如中所示正常工作?JSFIDLE??如果它可以或复制你问的问题中的代码。抱歉Rohan,但我仍然没有得到你到底想要什么?他们的任何工作演示?工作演示如中所示?jsFiddle??如果它可以或复制你问的问题中的代码。抱歉Rohan,但我仍然没有得到你到底想要什么谢谢你:-)这正是我需要的!!非常感谢:-)这正是我需要的!!