I am developing a html5 telematics app. My requirement is that i have a master window and on drag (open/close) of that, other windows should get dragged (open/close). Kindly help me know how could this be done. Below is my code
var div_FrontRight= $('<div/>', { id: 'FrontLeft'});
var div_FrontLeft= $('<div/>', { id: 'FrontLeft'});
var div_Master= $('<div/>', { id: 'Master'});
var div_RearRight= $('<div/>', { id: 'RearRight'});
var div_RearLeft= $('<div/>', { id: 'RearLeft'});
$("#AnimationWindow").append(div_FrontLeft);
$("#AnimationWindow").append(div_Master);
$("#AnimationWindow").append(div_RearRight);
$("#AnimationWindow").append(div_RearLeft);
var img_FrontLeft= $('<img/>', { id: 'imgFrontLeft', src:'../images/car.jpg'});
var img_Master= $('<img/>', { id: 'imgMaster', src:'../images/car.jpg'});
var img_RearRight= $('<img/>', { id: 'imgRearRight', src:'../images/car.jpg'});
var img_RearLeft= $('<img/>', { id: 'imgRearLeft', src:'../images/car.jpg'});
$("#FrontLeft").append(img_FrontLeft);
$("#Master").append(img_Master);
$("#RearRight").append(img_RearRight);
$("#RearLeft").append(img_RearLeft);
var div_stop= $('<div/>', { id: 'stop'});
$("#AnimationWindow").append(div_stop);
$( "#imgFrontLeft" ). draggable
({
axis: "y" ,
containment:[0,152,0,290]
});
$( "#imgMaster" ). draggable
({
axis: "y",
containment:[0,158,0,430]
});
$( "#imgRearRight" ). draggable
({
axis: "y",
containment:[0,337,0,470
});
$( "#imgRearLeft" ). draggable
({
axis: "y",
containment:[0,337, 0,470]
});
Individual Images independently are dragged. But my Requirement is that, On drag of Master, The other 4 windows also should be dragged. Is this Possible ? If yes then please help with the same.
Thanks in advance !!