Dear All,
I got a script where I can drag n drop.Below is a sample of codes to generate the layout first. Thereafter is the jquery codes.I can find the swap and serial hidden value for the drop place. Now my problem I want to find out the dragged swap and serial value how to do it?
Jquery
[CODE]$('.droppable').droppable({
drop: function(event, ui) {
var dest = $(this).find('img').attr('src');
var swapDest=$(this).find('[name^="Swap2"]').attr('value');
alert("swapDest: "+swapDest);
var source = ui.helper.attr('id');
}
I got a script where I can drag n drop.Below is a sample of codes to generate the layout first. Thereafter is the jquery codes.I can find the swap and serial hidden value for the drop place. Now my problem I want to find out the dragged swap and serial value how to do it?
Code:
<div class="t1"> <span class="droppable ui-droppable"> <b>F1L</b> <img class="draggable ui-draggable" src="tyreImages/tyre2.png"> <input type="hidden" value="3" name="1H"> <input type="hidden" value="0" name="Swap1"> <input type="hidden" value="EA12" name="Serial1"> </span> <span class="mid"> <span class="droppable ui-droppable"> <b>F1R</b> <img class="draggable ui-draggable" src="tyreImages/tyre2.png"> <input type="hidden" value="5" name="2H"> <input type="hidden" value="0" name="Swap2"> <input type="hidden" value="EA14" name="Serial2"> </span> </div>
[CODE]$('.droppable').droppable({
drop: function(event, ui) {
var dest = $(this).find('img').attr('src');
var swapDest=$(this).find('[name^="Swap2"]').attr('value');
alert("swapDest: "+swapDest);
var source = ui.helper.attr('id');
}