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);
感谢