我使用 http://readysetraphael.com/ 将 svg 转换为 raphaeljs 中的路径。我想更改它在页面上的位置。最终用随机数变量更改它,以便它在刷新时在屏幕上 move 。
http://jsfiddle.net/anderskitson/ZfzJg/
目前,当我尝试 move 时,路径会变得困惑。根据我在文档中读到的内容,路径类似于 "M10,20L30,40"
因此,如果我想更改路径放置位置的 x,y 坐标。不知道如何在不弄乱路径本身的情况下做到这一点
var path_a = paper.path("M242.07,270.119c0,0-14.596-30.606-7.625-35.793 c3.864-2.876,2.145-18.561,1.832-18.784c-0.313-0.224-1.839-0.319-1.839-0.319c-1.555-0.192-0.201-3.456-0.201-3.456 s0,0-0.598-0.352c-0.598-0.351,1.129-1.345,1.129-1.345c3.738-2.785,10.449-2.983,11.126-2.344c0.677,0.64-0.354,1.44-0.354,1.44 s0.73,0.832,1.333,2.111c0.604,1.28-0.792,1.665-0.792,1.665c1.852,6.718,9.877,14.935,9.877,14.935 c4.795,0.589,7.7,10.683,7.7,10.683l6.271,22.746C269.929,261.307,263.641,270.119,242.07,270.119z");
path_a.attr({fill: 'none',stroke: '#231F20',"stroke-width": '3',"stroke-miterlimit": '10','stroke-opacity': '1'}).data('id', 'path_a');
最佳答案
关于javascript - raphaeljs - move 我从 svg 转换的路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9458980/