【发布时间】:2013-09-16 21:57:47
【问题描述】:
我创建了this fiddle 来演示我的问题。请点击rotate按钮尝试移动黄色框(您可以在点击按钮之前进行)。
问题很明显 - 旋转后拖放以一种奇怪的方式工作。
我用谷歌搜索了这个问题,但没有找到解决方案。
代码:
html
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<button id="rotator">rotate</button>
<div id="map">
<div class="ball">whee</div>
<div class="ball">heyyy</div>
<div class="ball">hiii</div>
</div>
js
$(function() {
$(".ball").draggable();
$("#rotator").click(function(){
$("#map").css({
WebkitTransform: 'rotate(120deg)',
'-moz-transform': 'rotate(120deg)'
});
});
});
css
.ball {width: 100px; height: 100px; background: yellow; border: 1px solid red;}
#map {margin-top: 50px; border: black 1px solid; min-width: 250px; min-height: 250px;}
【问题讨论】:
标签: jquery jquery-ui rotation jquery-ui-draggable css-transforms