我有一個名爲'plan'的cookie,其中包含一個字符串值,表示一個RaphaelJS畫布以及其中的一些對象作爲SVG。確切的路徑等可能會有所不同,但這裏的typlically什麼東西被保存到cookie:從cookie傳遞SVG字符串到RaphaelJS
<svg height="100%" version="1.1" width="100%" xmlns="http://www.w3.org/2000/svg" style="overflow: hidden; position: relative;"><desc>Created with Raphaël 2.0.1</desc><defs/><path style="" fill="none" stroke="#d9e026" d="M153,74L384,74L384,304L0,304L0,150L153,150L153,74"/><path style="" fill="#333333" stroke="#d9e026" d="M160,160L160,220L220,220A60,60,0,0,0,160,160" transform="matrix(1, 0, 0, 1, -103, 84)"/><rect x="121.53846153846155" y="158.5" width="76.92307692307692" height="3" r="0" rx="0" ry="0" fill="#333333" stroke="#d9e026" style="" transform="matrix(1, 0, 0, 1, -89, -9)"/><rect x="83.0769230769231" y="156" width="76.92307692307692" height="5" r="0" rx="0" ry="0" fill="#333333" stroke="#d9e026" style="" transform="matrix(0, -1, 1, 0, 223.038, 364.039)"/></svg>
現在我需要能夠將這些數據傳遞到一個新的raphaeljs對象一個新的頁面上,並添加一些更多路徑等成它。
任何人都可以建議如何做到這一點,因爲我努力想知道從哪裏開始?
謝謝!
啊,謝謝Chasbeen。所以上面根本沒有必要使用這個庫? Paper.add將處理重新實例化Raphael實例的所有方面(包括轉換,旋轉等)? – Dan
其實,雖然在你的paper.add網站上有一個演示,但我在官方文檔http://raphaeljs.com/2.0/中看不到它。它是如此新(v2.0.1),它只是沒有記錄? – Dan
Dan單擊Raphael.add旁邊的Raphael鏈接Raphael.add函數已在2.01中添加,但這些鏈接(離站點旁邊的演示)始終指向最新的文檔... – Chasbeen