I'm working on a project where a user has to drag and drop the correct items onto a technical drawing. For example, a motherboard: the user will get a picture of a CPU or DDR memory, and he will have to drag that CPU onto the socket and the memory into the corresponding slot.
It's working great and it get's loaded into our website inside an iFrame. Since this website is responsive, the drag & drop app need to resize too. We resized the iFrame by scaling the body element inside using CSS3 transforms.
This too works, but the issue which then pops up is that all our drop zones are off. Now, one has to drop the CPU next to the socket to get it to react.
Here a simple example of what I mean: http://jsfiddle.net/78EYh/
Simply drag the blue square onto the red rectangle, and you'll see the red rectangle registering it's on top of it when you're not. Remove the div that scales, and all is normal. Only problem is I can't get around scaling the iframe, so I need a fix.
Has anyone encountered this issue before? Anyway to fix it?
HTML:
<div id="scale">
<span id="drop-1" class="drop"></span>
<span id="drag-1" class="drag"></span>
</div>
jQuery:
$("#drop-1").droppable({
over: function() {
$(this).css({'opacity' : '.4'});
},
out: function() {
$(this).css({'opacity' : '1'});
}
});
$("#drag-1").draggable();