Jquery draggable with zoom problem
- by Manuel
I am working on a page in witch all its contents are scaled by using zoom.
The problem is that when I drag something in the page the dragging item gets a bad position that seems relative to the zoom amount.
To solve this I tried to do some math on the position of the draggable component, but seems that even tho visually its corrected, the "true" position its not recalculated.
here is some code to explain better:
var zoom = Math.round((parseFloat($("body").css("zoom")) / 100)*10)/10;
var x = $(this).data('draggable').position;
$(this).data('draggable').position.left = Math.round(x.left/zoom);
$(this).data('draggable').position.top = Math.round(x.top/zoom);
Any help would be greatly appreciated