I have a window with a child inside. Child should be moving inside window. Window is scaled using css transform (-webkit-transform). I tried something like this:
html
<div class="window">
<div class="rect"></div>
</div>
css
.window
{
width: 640px;
height: 480px;
background: gray;
position: absolute;
-webkit-transform: translate(-25%, -25%) scale(0.5);
}
.rect
{
width: 60px;
height: 40px;
background: red;
}
js
$(function() {
$('.rect').draggable({
containment: 'parent'
});
});
I've posted it here - http://jsfiddle.net/bLKQj/12/ The child moves slowly than cursor. If scaling will be >1 it will be moves faster. Howto fix it?
PS: In transform translate(-25%, -25%)
is for make scaling with fixed top-left corner.