jQuery draggable and -webkit-transform: scale();

后端 未结 2 1459
悲哀的现实
悲哀的现实 2020-12-10 08:17

I have a situation where inside a div there are draggable items. However, when the parent div is scaled using -webkit-transform, the d

2条回答
  •  醉酒成梦
    2020-12-10 08:46

    I think you need the Transformable (http://plugins.jquery.com/project/transformable) jQuery plugin, in order to 'normalize' the WebKit scaling. Then dragging will work as in Firefox.

    Here is the plugin - http://flin.org/js/jquery.transformable.js. I think it should resolve your problem. Here is my version of your code: http://jsfiddle.net/vMaXm/4/

    $("#parent").setTransform("scalex", 1.5);
    //$("#parent").setTransform("scaley", 1.5);
    $('.draggable').draggable({ containment: "parent" });
    

    However, at this moment, if I uncomment the middle line I get the same problem you report.

提交回复
热议问题