0
我想動畫與Raphaël.jsThis Demo使用背景圖像的矩形。雖然矩形尺寸已設置爲60x60,並且圖像尺寸絕對爲60x60,但圖像不適合矩形內部!動畫Raphaël.js形狀與背景圖像的問題
對我來說,這只是當我使用animate()函數,並沒有所有的圖像完美適合矩形內發生。
您能否讓我知道爲什麼會發生這種情況以及我如何解決問題?
var r = Raphael('canvas', 500, 500);
r.canvas.style.backgroundColor = '#ccc';
var st = r.set();
st.push(
r.rect(100,100,60,60),
r.rect(180,100,60,60),
r.rect(100,200,60,60)
);
st.attr({fill:"url(http://cdn2.image-tmart.com/prodimgs/1/13010995/Rose-Bouquet-of-Peach-Heart-Home-Decoration-Simulation-Red-Inside-Pink-Outside_3_60x60.jpg?1363942767)", "stroke-width": 0});
st.animate({transform: "t200,100"}, 500);
感謝