I am working on a page in witch all its contents are scaled by using panzoom. The problem is that when I drag something in the page the dragging item gets a bad position.
Jquery draggable with panzoom
2.3k Views Asked by Kaushik solanki At
2
There are 2 best solutions below
0

Here you are. I'm using browser js. Draggable of jquery UI and Panzoom
var viewport = $('.frame');
var $pz = $('.panzoom');
$pz.panzoom({
minScale: .8,
maxScale: 3,
onPan: function() {
// console.log('pan');
},
onStart: function(event) {
// console.log('start', event);
return true;
},
});
$('.item').draggable({
helper: 'clone',
appendTo: '.workspace',
zIndex: 100505,
stop: function(event, ui) {
event.target.remove();
},
});
I'm not sure but perhaps I found answer.
Here two point:
Below my code for zoomed background and move object over it. Scale cursor based on this answer
html
js