如何在开始旋转时保持克隆元素的旋转位置使用jquery
How to maintain position of rotation for cloned element when start rotating using jquery
当我克隆可旋转元素时,之前的旋转是在我开始克隆元素时开始的。PLS帮助这个
var newdiv = $(imageid).parent().clone();
var id = "div" + divid;
var imid = "img" + imgid;
$(newdiv).attr('id', id);
$(newdiv).find("img:first").attr("id", imid)
$(newdiv).css("z-index", newZindex);
$(newdiv).find('.ui-resizable-handle').remove();
var position = $(imageid).parent().position();
$(newdiv).addClass("selected clone").css({ "top": position.top + 20, "left": position.left + 20 }).appendTo("#selectable");
$("#" + id).rotatable({ handle: $(newdiv).find('img:last').addClass("rotatable-handle") }, {
stop: stopHandlerRotate,
start: startHandlerRotate
}).resizable({
handles: "n, e, s, w, nw, ne, sw,se"
}, {
stop: stopHandlerResize,
start: startHandlerResize
}).draggable({
stop: stopHandlerDrag,
start: startHandlerDrag
});
当我克隆元素时,它像这样检查图像克隆。当我点击开始旋转时,它会转到起始位置。检查图像克隆旋转
我在这里找到了重新绑定之前的先前角度,并在绑定时给出了它。
$("#" + id).rotatable({ handle: $(newdiv).find('img:last').addClass("rotatable-handle") },{angle:previousangle}, {
stop: stopHandlerRotate,
start: startHandlerRotate
}).resizable({
handles: "n, e, s, w, nw, ne, sw,se"
}, {
stop: stopHandlerResize,
start: startHandlerResize
}).draggable({
stop: stopHandlerDrag,
start: startHandlerDrag
});
相关文章:
- 单击链接时如何将引导程序转盘旋转到特定位置
- 有没有办法得到引导3旋转木马的索引位置
- JQuery-随机元素在容器内的绝对位置和旋转
- 旋转分区的绝对位置
- googleMap标记旋转位置发生变化
- 三.js使用矩阵旋转时对象位置问题
- HTML5 Canvas - 如何在旋转后获取对象的绝对位置
- 三.js将盒子旋转到鼠标位置不起作用
- 在 SVG 动画中围绕舞台原点以外的其他位置旋转路径
- 使用轨迹球控制时重置摄像机位置/旋转
- 如何在ios应用程序中更改位置iPhone时制作旋转照片
- 如何计算旋转图像的正确位置偏移
- 如何在旋转时将图像保持在原始位置
- CSS3变换使用鼠标位置旋转
- CSS3变换使用鼠标位置旋转-第二阶段
- HTML5画布中旋转矩形内的鼠标位置
- Three.js将球体旋转到任意位置
- 计算旋转后长方体阴影的位置
- 如何在开始旋转时保持克隆元素的旋转位置使用jquery
- 如何使用 cgscenegraph 框架设置中心旋转位置