0

Hello I have problem with my cursor in jQuery draggable on scaled element. My code looks like :

$(".jdragable").draggable({
  revert: false,
  scroll: false,
  appendTo: '.page',
  helper: 'clone',
  zIndex: 3000,
  start: function(event, ui) {
    // hide parent element
    $(event.target).hide();

    // apply scale on cloned element
    $(ui.helper).css({
      transform: 'scale(' + getScale() + ')'
    });
  },
  stop: function(event, ui) {
    $(event.target).show();
  },
  drag: function(event, ui) {}
});

When I start drag if scale is 1 everything works pretty, but when scale is lower, let's say 0,5 cursor has strange position (displacement).

What should I do to have cursor on same position on element as dragged start ?

Please help.

Shiladitya
  • 12,003
  • 15
  • 25
  • 38
Juri Bojka
  • 305
  • 2
  • 8
  • 18
  • Similar but not exact duplicate: https://stackoverflow.com/questions/13882070/jquery-draggable-and-webkit-transform-scale – Twisty Nov 17 '17 at 15:45
  • Possible duplicate of [jQuery Drag/Resize with CSS Transform Scale](https://stackoverflow.com/questions/10212683/jquery-drag-resize-with-css-transform-scale) – Twisty Nov 17 '17 at 15:46
  • 1
    If you can add fiddle we can help you better. – Ali Soltani Nov 18 '17 at 06:24

0 Answers0