Javascript 要拖动示例图像而不是真实元素吗
我有一个svg元素。当我拖动元素时,应该在相同的位置创建一个该大小的示例图像,并且应该开始拖动,而不是真正的svg元素。这是 Try is代码: 这里Javascript 要拖动示例图像而不是真实元素吗,javascript,jquery,svg,d3.js,Javascript,Jquery,Svg,D3.js,我有一个svg元素。当我拖动元素时,应该在相同的位置创建一个该大小的示例图像,并且应该开始拖动,而不是真正的svg元素。这是 Try is代码: 这里 function dragmove(d) { d3.select("#sample") .attr("fill",d3.select(this).attr("fill")) .attr("opacity","0.7") .attr("x", d.x = d3.event.x)
function dragmove(d) {
d3.select("#sample")
.attr("fill",d3.select(this).attr("fill"))
.attr("opacity","0.7")
.attr("x", d.x = d3.event.x)
.attr("y", d.y = d3.event.y);
}
你刚才问了这个问题
function dragmove(d) {
d3.select("#sample")
.attr("fill",d3.select(this).attr("fill"))
.attr("opacity","0.7")
.attr("x", d.x = d3.event.x)
.attr("y", d.y = d3.event.y);
}