JQuery Select and drag Chrome issue

I have a select and drag function. Basically you can select 3 elements and drag them together.

The problem is in Chrome. If one element has the correctness "-webkit-transform: rotate", the entire range jumps up. This is strange because it works fine in Firefox.

You can see a working example: http://jsfiddle.net/K2EX9/4/ just try it in Chrome, select 3 elements with the mouse and drag them.

Here is the code:

$('#selectable1').bind('dragSetup', function() {

  var selected = $([]), offset = {top:0, left:0};

    $('#selectable1 span.drag').draggable({
                start: function(ev, ui) {
                $(this).is("#selectable1 span.ui-selected") || $("#selectable1 span.ui-selected").removeClass("ui-selected");
                selected = $("#selectable1 span.ui-selected").each(function() {
                var el = $(this);
                el.data("offset", el.offset());

                });

                offset = $(this).offset();

            },

            drag: function(ev, ui) {

                var dt = ui.position.top - offset.top, dl = ui.position.left - offset.left;

                selected.not(this).each(function() {
                    var el = $(this), off = el.data("offset");
                    el.css({top: off.top + dt, left: off.left + dl});
                });
            },
    });

});

Thank.

+3
source share
1 answer

IE9 ( mac), , . , IE .

: , ...

0

Source: https://habr.com/ru/post/1750655/


All Articles