我正在尝试使用jQuery UI.The拖动图像问题是这样的:当我拖动图像时,它会跳到开始拖动。我在谷歌上搜索了一下,发现这是由于css position
Absolute
造成的,但没有找到任何解决方案。
这是代码jsfiddle
#currentimage img {
position: absolute;
top: 0;
left: 0;
}
$(document).ready(function () {
$("#dragable").draggable().css({
"transform":" scale(2.79)",
"opacity": "0.90",
"left": "240px",
"top": "79px"
});
});
如何在不跳转的情况下拖动具有绝对位置的变换元素
发布于 2014-07-16 16:22:17
在CSS中设置图像的大小。把draggable
上的transform
取下来。
jQuery
$("#dragable").draggable()
.css({
"opacity": "0.90",
"left": "240px",
"top": "79px"
});
CSS:
#currentimage img {
position: absolute;
width: 80%;
}
Demo Here
https://stackoverflow.com/questions/24775408
复制相似问题